When attempting to remove the prefix p. from an HGVS protein variant string (e.g., p.Gly34Asp) using the str.strip() method, the trailing character of the amino acid abbreviation is incorrectly removed if it matches any character in the strip set.
>>> variant = "p.Gly34Asp"
>>> variant.strip("p.")
'Gly34As'
>>> variant.strip().removeprefix("p.")
'Gly34Asp'
|
clean_variant = variant.strip("p.") # Remove the p. if its present |
When attempting to remove the prefix
p.from an HGVS protein variant string (e.g., p.Gly34Asp) using the str.strip() method, the trailing character of the amino acid abbreviation is incorrectly removed if it matches any character in the strip set.BIAS-2015/src/preprocessing/extract_from_avada_track.py
Line 100 in 8f74048