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
Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?
Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating...-
Channel: Articles
10-14-2026, 09:55 AM -
-
by SEQadmin2
Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.
We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing...-
Channel: Articles
-
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, 10-22-2026, 11:13 AM
|
0 responses
23 views
0 reactions
|
Last Post
by SEQadmin2
10-22-2026, 11:13 AM
|
||
|
Started by SEQadmin2, 10-22-2026, 10:48 AM
|
0 responses
20 views
0 reactions
|
Last Post
by SEQadmin2
10-22-2026, 10:48 AM
|
||
|
Started by SEQadmin2, 10-15-2026, 10:52 AM
|
0 responses
36 views
0 reactions
|
Last Post
by SEQadmin2
10-15-2026, 10:52 AM
|
||
|
Started by SEQadmin2, 10-14-2026, 05:39 AM
|
0 responses
42 views
0 reactions
|
Last Post
by SEQadmin2
10-14-2026, 05:39 AM
|
Comment