This is a test version of Biostars. For the public version, visit https://www.biostars.org.
"C" and "G" positions

I need to creat a BED file with all "C"s positions, and another one with all "G" position in Human38. how can I do that?

r genome

Locating A Sequence In A Fasta File.

Be aware that the list is going to be extensively long and big, given roughly 25% of nucleotides being either G or C this will be 750.000.000 entries per C and G.

it semms like im missing something... /path/ref.fa.fai - what path should it be?

path to the indexed fasta reference (indexed with 'samtools faidx`)

1 answer

cut -f 1 /path/ref.fa.fai  | while read S ; do  samtools faidx -n 1 /path/ref.fa $S | awk -v S=$S '/^[CGcg]/ {printf("%s\t%d\t%d\n",S,NR-1,NR);}' ; done

Log in to answer this question.