From 329f68aee8ad02287c95e0af5de084c0cd86383a Mon Sep 17 00:00:00 2001 From: Steven Sutcliffe Date: Mon, 8 Jul 2024 19:08:07 -0400 Subject: [PATCH] Coerce PMID column into string not integer --- staramr/blast/pointfinder/PointfinderDatabaseInfo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/staramr/blast/pointfinder/PointfinderDatabaseInfo.py b/staramr/blast/pointfinder/PointfinderDatabaseInfo.py index f6adfbe..915290f 100644 --- a/staramr/blast/pointfinder/PointfinderDatabaseInfo.py +++ b/staramr/blast/pointfinder/PointfinderDatabaseInfo.py @@ -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 @@ -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. @@ -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