This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Extract Contigs From Scaffolds

Does anyone know a script to extract contigs from scaffols which have "NNNN"?

> scaffold1

atatttcccaaannnatatcccttggannnnnnaaacccttgagtttagga

> c1

atatttcccaaa

> c2

atatcccttgga

> c3

aaacccttgagtttagga

deleted-post

you could simply use a regular expression splitting the fasta sequence, something like split /[nN]+/ in Perl (I think it's the almost the same in awk syntax). But: are you completely sure that any N comes only from the scaffolding process?

It supposes to be generated from scaffolding steps when we perform the scaffolding using PE read information. I will try awk split to see if it works. Thanks!

But then you have the original contig data?? Why don't you just map them back to the scaffolds?

I don't have the original contig data. Also i would like to check the scaffolding...because it sometimes introduce misassembly...

I don't have the original contig data. Also i would like to check the scaffolding...because it sometimes introduce misassembly...

You probably want the scaffold position of the contigs in the contig names too.

1 answer

seqtk cutN -n 20 -p 100 scaf.fa > ctg.fa

seqtk

Log in to answer this question.