I have a word file with 222 pages worth of fasta genes... that adds up. The phylogenetic program I plan to use doesn't like a long FASTA header all that much, so I have to change it to something less than 10 characters. considering the large number of genes I have in the document, I would like to know a way to change all these names in a quicker manner than just manually changing each and every one. I'm aware that building a program can solve this, but I only have introductory experience in python. Any advice? Thanks!
Unconfigured Ad
Collapse
X
-
-
First of all, you should not have sequence data in a word file. That is just asking for trouble. Second, you can easily edit the fasta headers in the *nix command line, given that your sequences are in a plain text file. So put your seqs into a proper text file and then post example headers and what you want them to look like..savetherhino.org
-
Do you mean MS Word document? If so, save it as text file. When asked, use "LF only" as newline character. As an aside, don't keep sequence or any other sort of data in Word documents, you are going to make your bioinformatic life really complicated with that!Originally posted by aniben View PostI have a word file with 222 pages worth of fasta genes...
Are you sure only 10 characters are allowed? That sounds a bit weird... Anyway, if you really want to cut sequence names short you could use this crude way:The phylogenetic program I plan to use doesn't like a long FASTA header all that much, so I have to change it to something less than 10 characters.
Replace 10 with the desired number of chars to keep, seq.fa.txt is the text file saved as above.Code:awk '{if($0 ~ /^>/){x= substr($0, 1, 10); print x} else {print $0}}' seq.fa.txt > shortnames.fa
Comment
-
-
As you make these changes keep in mind that those 10 characters have to be unique (and logical enough for you to understand the trees afterwards) otherwise the phylogenetic program may not like it.
How many sequences do you have in that file? Are they all unique? It may be easier to name them 1,2,3 .. based on Brian's suggestion and then convert back to real names once you complete the analysis (photoshop?)
Comment
Latest Articles
Collapse
-
by SEQadmin2
The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.
This convergence of genetics, immunology, and computation...-
Channel: Articles
09-01-2026, 05:41 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, 09-09-2026, 12:14 PM
|
0 responses
16 views
0 reactions
|
Last Post
by SEQadmin2
09-09-2026, 12:14 PM
|
||
|
Started by SEQadmin2, 09-09-2026, 11:33 AM
|
0 responses
11 views
0 reactions
|
Last Post
by SEQadmin2
09-09-2026, 11:33 AM
|
||
|
Started by SEQadmin2, 09-03-2026, 10:22 AM
|
0 responses
26 views
0 reactions
|
Last Post
by SEQadmin2
09-03-2026, 10:22 AM
|
||
|
Started by SEQadmin2, 09-02-2026, 12:32 PM
|
0 responses
41 views
0 reactions
|
Last Post
by SEQadmin2
09-02-2026, 12:32 PM
|
Comment