Skip to content

Commit

Permalink
minor bug fixes in full code execution
Browse files Browse the repository at this point in the history
  • Loading branch information
CCranney committed Aug 8, 2023
1 parent 28e2b5e commit a19dcd9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 3 additions & 5 deletions csodiaq/csodiaq.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ def main():
outFileHeader = create_outfile_header(args['outDirectory'], queryFile, args['correction'])
for dfType, df in outputDict.items():

if dfType != "fullOutput":
dfType += "FDR"
df.to_csv(f'{outFileHeader}_{dfType}.csv', index=False)
if args["proteinTargets"]:
targetedReanalysisDict = create_mass_spec_input_dataframes_for_targeted_reanalysis_of_identified_peptides(outputDict["proteinFDR"], isIncludeHeavy=args['heavyMz'], maximumPeptidesPerProtein=args['proteinTargets'])
targetedReanalysisDict = create_mass_spec_input_dataframes_for_targeted_reanalysis_of_identified_peptides(outputDict["proteinFDR"], isIncludeHeavyIsotopes=args['heavyMz'], maximumPeptidesPerProtein=args['proteinTargets'])
else:
targetedReanalysisDict = create_mass_spec_input_dataframes_for_targeted_reanalysis_of_identified_peptides(outputDict["peptideFDR"], isIncludeHeavy=args['heavyMz'], maximumPeptidesPerProtein=args['proteinTargets'])
targetedReanalysisDict = create_mass_spec_input_dataframes_for_targeted_reanalysis_of_identified_peptides(outputDict["peptideFDR"], isIncludeHeavyIsotopes=args['heavyMz'], maximumPeptidesPerProtein=args['proteinTargets'])
for dfType, df in targetedReanalysisDict.items():
if "CV" in dfType:
df.to_csv(f'{outFileHeader}_mostIntenseTargs_{dfType}.txt', index=False, sep='\t')
Expand Down Expand Up @@ -96,7 +94,7 @@ def main():
# Post-processing
# Check whether we should do anything
if args['commonpeptide']:
print(f'Performing protein quantification and identifying common peptpides...', flush=True)
print(f'Performing protein quantification and identifying common peptides...', flush=True)
peptide_quantification.get_all_peptide_quantities(file_list=args['files'],
library_file=args['library'],
csodiaq_output_dir=args['outDirectory'],
Expand Down
9 changes: 8 additions & 1 deletion csodiaq/peptide_quantification.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ def get_peptide_quantities(file_list: list,
if common_dataframe.shape[0] == 0:
return
# Load library
library_dataframe = pd.read_csv(library_file, sep='\t')
if library_file.endswith('.csv'):
sep = ','
elif library_file.endswith('.tsv'):
sep = '\t'
else:
raise ValueError('library must be either .csv or .tsv')

library_dataframe = pd.read_csv(library_file, sep=sep)

# Get experimental spectra
exp_data = []
Expand Down

0 comments on commit a19dcd9

Please sign in to comment.