Skip to content

Commit

Permalink
changed dtype of chromosome to str in gget cosmic
Browse files Browse the repository at this point in the history
  • Loading branch information
josephrich98 committed Feb 16, 2025
1 parent e5aebd1 commit 61073ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 1 addition & 13 deletions gget/gget_cosmic.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,6 @@ def select_reference(
return file_path, overwrite


def convert_chromosome_value_to_int_when_possible(val):
try:
# Try to convert the value to a float, then to an int, and finally to a string
return str(int(float(val)))
except ValueError:
# If conversion fails, keep the value as it is
return val


def cosmic(
searchterm,
entity="mutations",
Expand Down Expand Up @@ -390,10 +381,7 @@ def cosmic(
# }
# )

from gget.gget_mutate import (
mutation_pattern,
convert_chromosome_value_to_int_when_possible,
)
from gget.gget_mutate import mutation_pattern, convert_chromosome_value_to_int_when_possible
import numpy as np

# * uncomment to include strand information (tested not to be accurate for CMC)
Expand Down
2 changes: 1 addition & 1 deletion gget/gget_mutate.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def convert_chromosome_value_to_int_when_possible(val):
return str(int(float(val)))
except ValueError:
# If conversion fails, keep the value as it is
return val
return str(val)


def merge_gtf_transcript_locations_into_cosmic_csv(
Expand Down

0 comments on commit 61073ce

Please sign in to comment.