Are you sure you are specifying the correct type? Please see this section of the importing tutorial in which aligned representative FASTA sequences are discussed. Perhaps you need to specify the 'FeatureData[AlignedSequence]' type. If that doesn't work, would you mind sharing the .fna you are working with?
If you zip the file up first, you will be able to attach it.
What did you do to "clean the line?" Did the error message report an invalid character at a different position after that?
I think it's safe to assume that this is not a bug and that the error message is correct: your fasta file is likely corrupt and will need to be modified. If you search for "does not match IUPAC characters for a DNA sequence" on the forum, you will find that this error can arise for a variety of reasons. The solutions others have found may or may not work for you depending on what's wrong with your file. We will need to diagnose precisely what is wrong with your fasta file before prescribing a fix. The first thing that jumps out to me is the blank lines. If you remove the blank lines, are you able to import the file?
I removed some blank lines. I could not remove all because there are many lines. The result was changing in line number as you see:
at position 0 on line 238 (does not match IUPAC characters for a DNA sequence).
Would it be a clue?
I checked it out, but I could not find a solution in my case. I am using recript plugin while the people question were regarding dada2 and so forth on.
You can remove all of the blank lines using the sed command like so: sed '/^$/d' sequence.fna > sequence_clean.fna. This will create a new file without the blank lines. That file is importable as type 'FeatureData[Sequence]'.
Thanks. Could you please tell me which environment I should execute this command? In Qiime2 command line interface? or what? You know, I have not seen such characters in Qiime2 commands so far " sed '/^$/d'" that is why I wanted to make sure what is the environment.
If it is Qiime2 plugin, please tell me its address what plugin is there.
By the way, I already saw some invalid characters in this file like repetitive three digit (33333333333) among the AGCT nucleotide. How can I remove them?