Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This my code It will print any line start with # Query: lnl|NZ Now I need print

ID: 3907844 • Letter: T

Question

This my code It will print any line start with # Query: lnl|NZ Now I need print all lines next the line # Query: lnl|NZ and next and next I mean PhD print t1.py outputblast 1 inport glob 3 prot- glob.glob.faa) 6 for p tn prot: CAFE-master a open(, output/' + p, with open(p) as infile: 'w') 10 for lines in infile: CAFE-master(2).z if lines.startswith Query: IcLINZ): print(1ines) a.write(lines) 12 13 14 15 a.close() Zisland_Explore README Zi??? fatemah@CAS-GB13Y12:-/Desktop/FASTAN/output1 ment (19819..19453)] [gbkey-Cos] # Database: /home/fatenah/Desktop/FASTANucleottde/blastdb/db-out # Fields: query td, % identity, % query coverage per hsp, % query coverage per s ubject, alignment length, ntsnatches, gap opens, q. start, q. end, s. start, s. end, evalue, bit score # 42 hits found # BLASTN 2.7.1+ # Query: 1c1INZ-CP007691.1-cds_19 [locus-tag-BSPT1_ASO0080]. [protein-acyltrans fe rase] [pseudo-true] [location-compienent (19630..20752)] [gbkey-CDS] # Database: /hone/fatenah/Desktop/FASTANucleottde/blastdb/db-out # Fields: query td, % tden tity, % query coverage per hsp, % query coverage per s ubject, alignnent length, ntsnatches, gap opens, q. start, q end, s. start, s. end, evalue, bit score # 45 hits found # BLASTN 2.7.1+ # Query: 1c1INZ-CPe6769 1.1-cdSMP002965271. 1-20 [locus-tag-8SPT1_Aseee98] [prot eln TIGRe2360 fantly protein] [protein_id HP 002965271.1] [locatton complenent(2 1275..21658)] [gbkey CDS] # Database: /home/fatenah/Desktop/FASTANucleottde/blastdb/db-out # Fields: query td, % tdentity, % query coverage per hsp, % query coverage per s ubject, alignnent length, misnatches, gap opens, q. start, q. end, s. start, s. end, evalue, bit score # 45 hits found fatenah@CAS-GB13Y12:-/Desktop/FASTAN/outputis BLAST files protocolforblast.GCA 000007125.1 blosum65.txt ASM712v1 protein faa odt umberofPlasmid s.docx

Explanation / Answer

import glob

prot = glob.glob('*.fas')

count = -1
for p in prot:
      a = open('output/' + p,'w')
      with open(p) as infile
           for lines in infile:
               if count > 0:
                  print(lines)
                  count = count-1
               if lines.startswith('# Query: ...(your code line)
                  count = 4

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote