Skip to content

Commit

Permalink
Coerce PMID column into string not integer
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsutcliffe committed Jul 8, 2024
1 parent d8370b7 commit 329f68a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions staramr/blast/pointfinder/PointfinderDatabaseInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def from_file(cls, file):

with open(file) as f:
line = f.readline()

line = line.lstrip("#")
column_names = line.split()

pointfinder_info = pd.read_csv(file, sep='\t', index_col=False, comment='#', header=None, names=column_names)

pointfinder_info["PMID"] = pointfinder_info["PMID"].astype(str)
return cls(pointfinder_info, file)

@classmethod
Expand All @@ -53,7 +53,7 @@ def from_pandas_table(cls, database_info_dataframe):
:return: A new PointfinderDatabaseInfo.
"""
return cls(database_info_dataframe)

@staticmethod
def to_codons(regex_match):
# Sometimes, the regex will match a string with a comma and return multiple matches.
Expand Down Expand Up @@ -120,7 +120,7 @@ def _get_resistance_codon_match(self, gene, codon_mutation):
# so we need to convert to nucleotide coordinates before making the comparison.
& (table['Ref_codon'] == codon_mutation.get_database_amr_gene_mutation())
& (table['Res_codon'].str.contains(codon_mutation.get_input_genome_mutation(), regex=False))]

# We need to handle codon insertions as a special case:
# Pointfinder mis-reports the position of codon insertions. For example:
# ref: ACG --- ACG
Expand Down

0 comments on commit 329f68a

Please sign in to comment.