Skip to content

Commit

Permalink
Updated bowtie2 setting to be compatible with long reads
Browse files Browse the repository at this point in the history
  • Loading branch information
kbessonov1984 committed Nov 7, 2024
1 parent ee4db4e commit c203a3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ectyper/genomeFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,10 @@ def assemble_reads(reads, bowtie_base, combined_fasta, temp_dir, cores=1):
bowtie_run = [
'bowtie2',
'--threads',f'{cores}',
'--local',
'--score-min L,1,-0.5',
'--np 5',
'--no-unal',
'-x', bowtie_base,
'-U', reads,
'-S', sam_reads
Expand All @@ -248,7 +250,7 @@ def assemble_reads(reads, bowtie_base, combined_fasta, temp_dir, cores=1):
'samtools', 'view',
'--threads', f'{cores}',
'-S',
'-F 4',
'-F 4', #filter out the unmapped reads
'-q 1',
'-b',
'-o', bam_reads,
Expand Down
3 changes: 1 addition & 2 deletions ectyper/predictionFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ def get_prediction(per_genome_df):

#find pairwise distance between all alleles indentified by BLAST search and find alleles with IDENTICAL O-antigen score
#Note that difference in score of 0 between O antigens is considered to be identical

identicalscorestupleslist = [(orow, ocol, abs(i - j)) for ocol, i in scorestupleslist for orow, j in scorestupleslist
if i - j == 0 and (orow == selectedOantigen or ocol == selectedOantigen) and
(orow != ocol)]
Expand All @@ -548,7 +547,7 @@ def get_prediction(per_genome_df):


if highsimilarity_oantigens:
mixedoantigen = [selectedOantigen] + highsimilarity_oantigens
mixedoantigen = sorted([selectedOantigen] + highsimilarity_oantigens, key = lambda x: re.search('O(\d+)',x).group(1), reverse=True)
serotype['O']['serogroup'] = "/".join(mixedoantigen)
LOG.info("Highly similar O-antigen candidates were found for {}".format(mixedoantigen))
elif selectedOantigen != "":
Expand Down

0 comments on commit c203a3b

Please sign in to comment.