Skip to content

Commit

Permalink
validate_peptides.py -> spectrumai.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Apr 24, 2024
1 parent f2d58c8 commit 6a55e16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pypgatk/proteogenomics/blast_get_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def get_details(fasta, peptide):
def peptide_blast_protein(fasta, peptide):
length = len(peptide)
mismatch = []
if len(fasta) >= length:
score = pairwise2.align.localms(sequenceA=fasta, sequenceB=peptide,
if len(fasta) >= length:
score = pairwise2.align.localms(sequenceA=fasta, sequenceB=peptide,
match=1, mismatch=0, open=-2, extend=-2, score_only=True)
if score == length-1:
alignment = pairwise2.align.localms(sequenceA=fasta, sequenceB=peptide,
alignment = pairwise2.align.localms(sequenceA=fasta, sequenceB=peptide,
match=1, mismatch=0, open=-2, extend=-2)[0]
if alignment.end - alignment.start == length:
mismatch = get_details(alignment.seqA[alignment.start:alignment.end], alignment.seqB[alignment.start:alignment.end])
Expand Down Expand Up @@ -64,7 +64,7 @@ def _blast_set(fasta_dict, peptide):
for key,value in positions.items():
splits = key.split("|")
splits.append(",".join(value))
res.append(splits)
res.append(splits)
return res
else:
return "non-canonical"
Expand Down Expand Up @@ -94,7 +94,6 @@ def __init__(self, config_data, pipeline_arguments):
self.fasta_dict[str(j.seq)].add(j.id)
else:
self.fasta_dict[str(j.seq)] = {j.id}

self.blast_dict = Manager().dict()

def get_blast_parameters(self, variable: str, default_value):
Expand Down
1 change: 0 additions & 1 deletion pypgatk/proteogenomics/spectrumai.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ def validate(self, infile_name, outfile_name: str):
df_psm = pd.read_table(infile_name, header=0, sep="\t")
else:
raise ValueError("The input file format is not supported.")


if self._mztab:
grouped_dfs = df_psm.groupby("SpecFile")
Expand Down

0 comments on commit 6a55e16

Please sign in to comment.