text: user10366: I have a genbank file that I have been trying to run in HMMER using the following command:
  hmmscan --domtblout NC_000962.3.final.gbk.out -E 0.000001 prot_profile.hmm NC_000962.3.final.gbk
  
  However, since the file is too big for HMMER, I get the following error:
  Fatal exception (source file p7_pipeline.c, line 697): 
  Target sequence length > 100K, over comparison pipeline limit. 
  (Did you mean to use nhmmer/nhmmscan?) 
  Aborted (core dumped)
  
  I need to split this file into smaller files for the HMMER run. The problem is, I would need the ORIGIN field (containing the nucleotide sequence) at the bottom of the file split into relevant chunks into the subfile as well. This is where I am getting stuck.
  I have already looked at GenBank Parser and seqretsplit to no avail.
  I would greatly appreciate some help with this. Thank you.
  
  user3577: You can use NCBI EntrezDirect to download data in GenBank format for a specific region of the sequence as follows:
  efetch -db nuccore -id NC_000962.3 -format gb -seq_start 1 -seq_stop 99000 > seq.gb
  
  
  user7153: I don't have time to give you a polished fully functional version but this will get you started. The next step will be a bit harder as you will need to capture the start of the first CDS in the chunk and end of the last CDS instead of just hardcoding as I have here.
  fout = open('/path/first3.gbk','w')
  for record in SeqIO.parse('/path/NC_000962.3.final.gbk','genbank'):
      for i, feature in enumerate(record.features):
          new_record = record
          new_record.seq = new_record.seq[0:4437]
          new_record.features = new_record.features[:3]
          if i > 2:
              SeqIO.write(new_record, fout, 'genbank')
              fout.close()
              break
  
  
original_text: 10366: <p>I have a <a href="https://drive.google.com/file/d/18ImTLxSIv2o85TdwNcJOoQD64ibOmJUK/view?usp=sharing" rel="nofollow noreferrer">genbank file</a> that I have been trying to run in HMMER using the following command:</p>
  <pre><code>hmmscan --domtblout NC_000962.3.final.gbk.out -E 0.000001 prot_profile.hmm NC_000962.3.final.gbk
  </code></pre>
  <p>However, since the file is too big for HMMER, I get the following error:</p>
  <pre><code>Fatal exception (source file p7_pipeline.c, line 697): 
  Target sequence length &gt; 100K, over comparison pipeline limit. 
  (Did you mean to use nhmmer/nhmmscan?) 
  Aborted (core dumped)
  </code></pre>
  <p>I need to split this file into smaller files for the HMMER run. The problem is, I would need the <em>ORIGIN</em> field (containing the nucleotide sequence) at the bottom of the file split into relevant chunks into the subfile as well. This is where I am getting stuck.</p>
  <p>I have already looked at <em>GenBank Parser</em> and <em>seqretsplit</em> to no avail.</p>
  <p>I would greatly appreciate some help with this. Thank you.</p>
   3577: <p>You can use NCBI <a href="https://www.ncbi.nlm.nih.gov/books/NBK179288/" rel="nofollow noreferrer">EntrezDirect</a> to download data in GenBank format for a specific region of the sequence as follows:</p>
  <pre><code>efetch -db nuccore -id NC_000962.3 -format gb -seq_start 1 -seq_stop 99000 &gt; seq.gb
  </code></pre>
   7153: <p>I don't have time to give you a polished fully functional version but this will get you started. The next step will be a bit harder as you will need to capture the start of the first CDS in the chunk and end of the last CDS instead of just hardcoding as I have here.</p>
  <pre><code>fout = open('/path/first3.gbk','w')
  for record in SeqIO.parse('/path/NC_000962.3.final.gbk','genbank'):
      for i, feature in enumerate(record.features):
          new_record = record
          new_record.seq = new_record.seq[0:4437]
          new_record.features = new_record.features[:3]
          if i &gt; 2:
              SeqIO.write(new_record, fout, 'genbank')
              fout.close()
              break
  </code></pre>
  