I am trying to calculate the number of contigs in a scaffold file i.e. a consensus sequence separated by n's. I have been working on an assembly generated by Newbler and have closed some of the gaps computationally or experimentally. I need to know how many contigs are left in each scaffold. Could anyone point me in the right direction?
Unconfigured Ad
Collapse
X
-
The file 454Scaffolds.txt generated by Newbler has the information you need.
See http://contig.wordpress.com/2010/03/...-file/#more-56 for more information.
-
I should clarify: the assembly was imported in to gap4 and worked on by joining contigs to the scaffold consensus and closing gaps computationally or experimentally. I can save out the updated consensus files but these will still contain n's due to the scaffold sequence that I joined in. I need to find a way of calculating the number of contigs ie. the number of sequences separated by n's in this file.
Comment
-
Assuming you are a unix type system, one answer is to use the 'tr' command along with 'sed' and 'wc'. First get rid of the fasta headers. Then get rid of the newlines. Then reduce all the of the 'n's to a single character. Finally delete all non-n's and then count up the remaining n's. That number will represent the number of gaps you have plus one thus the number of contigs.
sed -e 's/>.*/n/' scaffold.fasta | tr -d '\n' | tr -s 'n' | tr -d 'acgt' | wc -c
The above assumes only acgtn in lower case. I suspect there are as many other answers as there are people on this bulletin board.
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-15-2026, 10:52 AM
|
0 responses
26 views
0 reactions
|
Last Post
by SEQadmin2
10-15-2026, 10:52 AM
|
||
|
Started by SEQadmin2, 10-14-2026, 05:39 AM
|
0 responses
34 views
0 reactions
|
Last Post
by SEQadmin2
10-14-2026, 05:39 AM
|
||
|
Started by SEQadmin2, 10-13-2026, 09:56 AM
|
0 responses
31 views
0 reactions
|
Last Post
by SEQadmin2
10-13-2026, 09:56 AM
|
||
|
Started by SEQadmin2, 10-09-2026, 11:14 AM
|
0 responses
28 views
0 reactions
|
Last Post
by SEQadmin2
10-09-2026, 11:14 AM
|
Comment