This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract Upstream And Downstream Of User Defined Region From An Fasta File

I have two file ,one is fsata,the other file has defined information like below

query-id  hit-id  plus/minus start-site end-site query-sequence
234    chr1AL-k71-126309 1120 117769    +    30    55    GTCGCGAGAAGTCCATTGAACCTTAT
285    chr1AL-k71-126309 1120 117769    +    397    429    TGCGATACCTGGTGTGAATTGCAGAATCCCGCG
332    chr1AL-k71-126309 1120 117769    +    414    432    ATTGCAGAATCCCGCGAAC
  5    chr1AL-k71-126309 1120 117769    +    423    452    TCCCGCGAACCATCGAGTCTTTGAACGCAA
121    chr1AL-k71-126309 1120 117769    +    430    447    AACCATCGAGTCTTTGAA
245    chr1AL-k71-126309 1120 117769    +    832    851    GCTTGAGAATCGGGCGGCTG
330    chr1AL-k71-126309 1120 117769    +    981    999    ACGAGTCGGGTTGTTTGGG
180    chr1AL-k71-126309 1120 117769    +    1075    1095    CGAGGGAAAGATGAAAAGGAC
309    chr1AL-k71-167040 262 977    +    131    151    CCTTTGTACACACCGCCCGTC
234    chr1AL-k71-167040 262 977    +    222    247    GTCGCGAGAAGTCCATTGAACCTTAT

I want to extract upstream and downstream 100bp (if upstream/downsteam length over than 100bp,else from the start/end site of hit sequence ).there is Sequence Subgroup Extractor,extract user defined region from an fasta file,who can change this or give a new?

fasta

1 answer

http://bedtools.readthedocs.org/en/latest/content/tools/getfasta.html

bedtools getfasta. To do the up and downstream, you may need bedtools flank and merge.

Log in to answer this question.