This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fetching the sequence from the genome

Hello everyone,

I have a genome with 4.3 GB size. I have run local blast for it. Now I want to fetch the sequence from the genome like from 700000 bps to 800000 bps. I don't have any information regarding chromosome coordinates or chromosome number etc. because it is a non-redundant data. I have tried to make bed file but it is also not working. I am a beginner. Please help me.

Thank you in advance.

genome

Hello and welcome to biostars zunera ,

I have tried to make bed file but it is also not working.

Please show us more details about what you have tried and what is "not working".

Two common ways to receive a region of interest are bedtools getfasta:

$ bedtools getfasta -fi genome.fa -bed myregions.bed

and samtools faidx:

$ samtools faidx genome.fa <chr>:<from>-<to>

Thank you for you reply.

I was using the wrong command for bedtools. The above command worked for me.

Secondly, the bed file was not in tab delimated format. So I used awk command to convert it into tab delimated format and the issue is resolved.

awk '{ for(i=1;i<=NF;i++){if(i==NF){printf("%s\n",$NF);}else {printf("%s\t",$i)}}}' bedfile.bed > output

0 answers

No answers yet.

Log in to answer this question.