-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ypriverol/master
q-values when Posterior Error probability
- Loading branch information
Showing
19 changed files
with
126,385 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import gzip | ||
import os | ||
import re | ||
import shutil | ||
|
||
import click | ||
import pandas as pd | ||
from typing_extensions import OrderedDict | ||
|
||
from ibaqpy_commons import * | ||
|
||
def print_help_msg(command) -> None: | ||
""" | ||
Print help information | ||
:param command: command to print helps | ||
:return: print help | ||
""" | ||
with click.Context(command) as ctx: | ||
click.echo(command.get_help(ctx)) | ||
|
||
|
||
@click.command() | ||
@click.option("-i", "--input", help="Folder with all the Intensity files", required=True) | ||
@click.option("-o", "--output", help="Prefix name for the file to group by condition") | ||
@click.option("-p", "--pattern", help="Prefix of the pattern name for all the files in the folder") | ||
def merge_condition_generation(input: str, output: str, pattern: str) -> None: | ||
""" | ||
Merge all the files in a folder with the specific pattern | ||
:param input: Input folder containing all the peptide Intensity files | ||
:param output: Output file prefix with all the intensities | ||
:param pattern: pattern of the files with the corresponding file name prefix | ||
:return: | ||
""" | ||
|
||
files = [f for f in os.listdir(input) if pattern in f] | ||
df_from_each_file = (pd.read_csv(input+"/"+f, sep="\t") for f in files) | ||
concatenated_df = pd.concat(df_from_each_file, ignore_index=True) | ||
concatenated_df[CONDITION] = concatenated_df[CONDITION].str.lower() | ||
print(concatenated_df.head()) | ||
|
||
for k, g in concatenated_df.groupby([CONDITION]): | ||
g.to_csv(f'{output}/{k}-grouped-Intensities.tsv', index=False, sep='\t') # '{}.csv'.format(k) | ||
|
||
|
||
if __name__ == '__main__': | ||
merge_condition_generation() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.