Skip to content

Commit

Permalink
Merge pull request #33 from bigbio/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ypriverol authored Feb 7, 2021
2 parents bb6b7ea + 5394b6b commit fbd50f9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 30 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [v0.0.10](https://github.com/bigbio/py-pgatk/tree/v0.0.10) (2021-02-05)

**Implemented enhancements:**

- Ensembl release [\#23](https://github.com/bigbio/py-pgatk/issues/23)
- Add a changelog.md to the project [\#22](https://github.com/bigbio/py-pgatk/issues/22)

## [v0.0.9](https://github.com/bigbio/py-pgatk/tree/v0.0.9) (2021-02-03)

**Implemented enhancements:**
Expand Down
56 changes: 27 additions & 29 deletions pypgatk/proteomics/db/decoy_pyrat.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,39 +199,37 @@ def decoy_database(self):
# empty protein sequence
seq = ''

# open temporary decoy FASTA file
outfa = open(self._temp_file, 'w')

# Open FASTA file using first cmd line argument
fasta = SeqIO.parse(self._input_fasta, 'fasta')
# loop each seq in the file
for record in fasta:
seq = str(record.seq)
dcount+=1
#make sequence isobaric (check args for switch off)
if not self._isobaric:
seq = seq.replace('I', 'L')

#digest sequence add peptides to set
upeps.update(ProteinDBService.digest(seq, self._cleavage_sites, self._cleavage_position,
self._anti_cleavage_sites, self._peptide_length))

#reverse and switch protein sequence
decoyseq = ProteinDBService.revswitch(seq, self._no_switch, self._cleavage_sites)

#do not store decoy peptide set in reduced memory mode
if not self._memory_save:
#update decoy peptide set
dpeps.update( ProteinDBService.digest(decoyseq, self._cleavage_sites, self._cleavage_position,
self._anti_cleavage_sites, self._peptide_length))

#write decoy protein accession and sequence to file
outfa.write('>' + self._decoy_prefix + record.id + '\n')
outfa.write(decoyseq + '\n')
# open temporary decoy FASTA file
with open(self._temp_file, 'w') as outfa:

# loop each seq in the file
for record in fasta:
seq = str(record.seq)
dcount+=1
#make sequence isobaric (check args for switch off)
if not self._isobaric:
seq = seq.replace('I', 'L')

#digest sequence add peptides to set
upeps.update(ProteinDBService.digest(seq, self._cleavage_sites, self._cleavage_position,
self._anti_cleavage_sites, self._peptide_length))

#reverse and switch protein sequence
decoyseq = ProteinDBService.revswitch(seq, self._no_switch, self._cleavage_sites)

#do not store decoy peptide set in reduced memory mode
if not self._memory_save:
#update decoy peptide set
dpeps.update( ProteinDBService.digest(decoyseq, self._cleavage_sites, self._cleavage_position,
self._anti_cleavage_sites, self._peptide_length))

#write decoy protein accession and sequence to file
outfa.write('>' + self._decoy_prefix + record.id + '\n')
outfa.write(decoyseq + '\n')

# Close files
fasta.close()
outfa.close()

# Summarise the numbers of target and decoy peptides and their intersection
nonDecoys = set()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def readme():
return f.read()

setup(name='pypgatk',
version='0.0.10',
version='0.0.11',
description='Python tools for proteogenomics',
url='http://github.com/bigbio/py-pgatk',
long_description=readme(),
Expand Down

0 comments on commit fbd50f9

Please sign in to comment.