This is a test version of Biostars. For the public version, visit https://www.biostars.org.
querying a database with a substring contained in a file fasta

Hello! I present my problem. I created with the command "makeblastdb" a database that contains my sequences of interest. Now I want to make a query: the file on which do the query (assume it's called NG_006672.fasta) contains a single sequence; I want to make a query on a substring of the sequence contained in my file, for example to take a substring of length 20. I would like to make a query being able to act on the indices of my query sequence

blast query blastdb

I would like to make a query being able to act on the indices of my query sequence.

Please clarify what you mean by this? This request does not match the first part of your question.

1 answer

you can use tools like EMBOSS, seqtk and so on to retrieve subsequence and then blast.

e.g., use subseq (usage) of SeqKit:

  • First 12 bases

    $ seqkit subseq -r 1:12 seqs.fa > subseq.fa
    
  • Last 12 bases

    $ seqkit subseq -r -12:-1 seqs.fa > subseq.fa
    
  • Subsequences without first and last 12 bases

    $ seqkit subseq -r 13:-13 seqs.fa > subseq.fa
    

Log in to answer this question.