From 08583a9d589e3c995db8d74c1ce9ef625655d00b Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Mon, 22 Apr 2024 20:21:47 +0100 Subject: [PATCH] small changes in blast -> USI accessions --- pypgatk/proteogenomics/blast_get_position.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pypgatk/proteogenomics/blast_get_position.py b/pypgatk/proteogenomics/blast_get_position.py index 428c731..4196fce 100644 --- a/pypgatk/proteogenomics/blast_get_position.py +++ b/pypgatk/proteogenomics/blast_get_position.py @@ -126,10 +126,16 @@ def blast(self, input_psm_to_blast, output_psm): start_time = datetime.datetime.now() print("Start time :", start_time) - if input_psm_to_blast.endswith(".gz"): + if input_psm_to_blast.endswith(".csv.gz"): psm = pd.read_csv(input_psm_to_blast, header=0, sep=",", compression="gzip") + elif input_psm_to_blast.endswith(".csv"): + psm = pd.read_csv(input_psm_to_blast, header=0, sep=",") + elif input_psm_to_blast.endswith(".tsv.gz"): + psm = pd.read_table(input_psm_to_blast, header=0, sep="\t", compression="gzip") + elif input_psm_to_blast.endswith(".tsv"): + psm = pd.read_table(input_psm_to_blast, header=0, sep="\t") else: - psm = pd.read_table(input_psm_to_blast, header=0, sep=",") + raise ValueError("The input file format is not supported.") psm = psm.head(4) psm = self._blast_canonical(psm)