This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extract sequence around snp

Hello, I would like to extract sequence around snp from the human genome like below. Is there any tools to do this?

CTGCTGGCCGTGATGGCCTATGACC[A/G]CTTTGTGGCCATCTGTAACCCTTTG

Thanks

dnaseq

@Jonessara770 Did you find a way to extract the SNP flanking sequences.

2 answers

Use 'samtools faidx', if you know the position of snp. You will also require the relevant reference build: samtools faidx ref.fasta chr1:2500026-2500063 adjust the range as required.

Create a bed file with range containing your snp position: chr pos-offset pos+offet
Exemple with 3 snps : (chr3:150050 ,chr4:150050,chr5:150050) and 10 nucleotid size margin :

  chr 3   150040 1500060
  chr 4   150040 1500060
  chr 5   150040 1500060

Then use bedtools to extract your sequences

  bedtools getfasta -fi hg19.fa -bed snp.bed -fo out.fa

You should get a list of all sequences founded.

once extract the SNP flanking sequences (bedtools getfasta), how to indicates SNP position in brackets [ ] with REF/ALT bases

Log in to answer this question.