Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lower score threshold - with adjustment to max PSM FDR of 2% MS2 branch #5

Open
wants to merge 3 commits into
base: ms2_recalibration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ProteoFileReader.pyc
Binary file not shown.
Binary file added fragpair_scoring.pyc
Binary file not shown.
Binary file added gui.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions mass_recal.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ def run_xi_lin(peakfile, fasta, cnf, outpath, xipath, threads='1'):


def get_ppm_error(xi_df, outfile):
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > 6)] # TODO: new xi version requires lower score?
score_cutoff = 2
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > score_cutoff)]
xi_df_decoy = xi_df[(xi_df.decoy == 1) & (xi_df['match score'] > score_cutoff)]

while (len(xi_df_decoy.index)>0.02*len(xi_df.index))
score_cutoff=min(xi_df['match score'][xi_df['match score'] > score_cutoff]);
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > score_cutoff)]
xi_df_decoy = xi_df[(xi_df.decoy == 1) & (xi_df['match score'] > score_cutoff)]


median_err = np.median(xi_df['Precoursor Error'])
try:
Expand Down Expand Up @@ -134,7 +142,7 @@ def main(mgf, fasta, xi_cnf, outpath, threads, xi_jar='./resources/XiSearch_1.6.
fasta = '//130.149.167.198/rappsilbergroup/users/MitoProject/For Swantje/20170109_uniprot_mitoIDrun_FASTA.fasta'
outpath = base_dir + '/error_shift'
for in_file in os.listdir(mgf_dir):
if '.mgf' in in_file:
if in_file.endswith('.mgf') and not in_file.startswith('recal_') :
main(mgf=os.path.join(mgf_dir, in_file),
fasta=fasta,
xi_cnf='D:/user/Swantje/projects/pipeline_prepro_xi_fdr/resources/xi_linear_by_tryp.conf',
Expand Down
Binary file added mass_recal.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions mass_recal_ms2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ def run_xi_lin(peakfile, fasta, cnf, outpath, xipath, threads='1'):


def get_ppm_error(xi_df, peaks_df, outfile):
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > 6)]
score_cutoff = 2
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > score_cutoff)]
xi_df_decoy = xi_df[(xi_df.decoy == 1) & (xi_df['match score'] > score_cutoff)]

while (len(xi_df_decoy.index)>0.02*len(xi_df.index)):
score_cutoff=min(xi_df['match score'][xi_df['match score'] > score_cutoff]);
xi_df = xi_df[(xi_df.decoy == 0) & (xi_df['match score'] > score_cutoff)]
xi_df_decoy = xi_df[(xi_df.decoy == 1) & (xi_df['match score'] > score_cutoff)]

median_err = np.median(xi_df['Precoursor Error'])
try:
fig, ax = plt.subplots()
Expand Down Expand Up @@ -156,7 +164,7 @@ def main(mgf, fasta, xi_cnf, outpath, threads, xi_jar='./resources/XiSearch_1.6.
fasta = '//130.149.167.198/rappsilbergroup/users/MitoProject/For Swantje/20170109_uniprot_mitoIDrun_FASTA.fasta'
outpath = base_dir + '/error_shift'
for in_file in os.listdir(mgf_dir):
if '.mgf' in in_file:
if in_file.endswith('.mgf') and not in_file.startswith('recal_'):
main(mgf=os.path.join(mgf_dir, in_file),
fasta=fasta,
xi_cnf='D:/user/Swantje/projects/pipeline_prepro_xi_fdr/resources/xi_linear_by_tryp.conf',
Expand Down
2 changes: 1 addition & 1 deletion preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def process_file(filepath, outdir, mscon_settings, split_acq, detector_filter, m
pool.close()
pool.join()

recal_in = [os.path.join(outdir, x) for x in os.listdir(outdir) if '.mgf' in x]
recal_in = [os.path.join(outdir, x) for x in os.listdir(outdir) if x.endswith('.mgf') and not x.startswith('recal_')]
if recal:
# pool = Pool(processes=nthr)
if not os.path.exists(outdir):
Expand Down
Binary file added preprocessing.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion preprocessing_ms2recal.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def process_file(filepath, outdir, mscon_settings, split_acq, detector_filter, m
pool.close()
pool.join()

recal_in = [os.path.join(outdir, x) for x in os.listdir(outdir) if '.mgf' in x]
recal_in = [os.path.join(outdir, x) for x in os.listdir(outdir) if x.endswith('.mgf') and not x.startswith('recal_')]
if recal:
# pool = Pool(processes=nthr)
if not os.path.exists(outdir):
Expand Down