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
When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...-
Channel: Articles
11-24-2026, 07:04 AM -
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, Yesterday, 11:10 AM
|
0 responses
12 views
0 reactions
|
Last Post
by SEQadmin2
Yesterday, 11:10 AM
|
||
|
Single-Nucleus Sequencing Links Type 2 Diabetes Risk Variants to Specific Muscle Cell Types
by SEQadmin2
Started by SEQadmin2, 12-01-2026, 11:06 AM
|
0 responses
21 views
0 reactions
|
Last Post
by SEQadmin2
12-01-2026, 11:06 AM
|
||
|
Started by SEQadmin2, 11-23-2026, 11:11 AM
|
0 responses
60 views
0 reactions
|
Last Post
by SEQadmin2
11-23-2026, 11:11 AM
|
||
|
Started by SEQadmin2, 11-17-2026, 06:27 AM
|
0 responses
56 views
0 reactions
|
Last Post
by SEQadmin2
11-17-2026, 06:27 AM
|
Comment