-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Software updates, enhancements and bugfixes
- GATK 4.5.0.0 - CNVkit 0.9.11 - BLAST 2.15 - multiqc 1.21 - pVACtools 4.1.1(fixes #43, #60, #66) - VEP 111.0 - added DeepImmuno to pVACseq predictors - remove sequenza from nextNEOpiENV and use it in separate ENVS - switch from SGE to slurm in cluster profile example - set process memory defaults for resource reservation to avoid OOM kills - set default process time directive for max process execution time - refine process CPU directive settings for - fix custom HLA file handling (fixes and closes #70, thanks to @mantczakaus) - added custom HLA file example (closes #72) - changed the way how pvacseq results are concatenated. Now a python script using pandas is doing the job.
- Loading branch information
Showing
9 changed files
with
266 additions
and
169 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
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
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,51 @@ | ||
#!/usr/bin/env python | ||
|
||
""" | ||
Concatenate pvacseq outputfiles | ||
Requirements: | ||
* Python >= 3.6.2 | ||
* pandas >= 1.4 | ||
Copyright (c) 2024 Dietmar Rieder <dietmar.rieder@i-med.ac.at> | ||
MIT License <http://opensource.org/licenses/MIT> | ||
""" | ||
|
||
import os | ||
import argparse | ||
import pandas as pd | ||
|
||
def concat_files(directory, pattern): | ||
# List all files in the current directory that match the pattern | ||
files_to_concat = [os.path.join(directory, file) for file in os.listdir(directory) if file.endswith(pattern)] | ||
print(files_to_concat) | ||
|
||
# Initialize an empty list to store DataFrames | ||
dfs = [] | ||
|
||
# Iterate over the files and read them into DataFrames | ||
for file in files_to_concat: | ||
df = pd.read_csv(file, sep="\t") | ||
dfs.append(df) | ||
|
||
# Concatenate the DataFrames | ||
result = pd.concat(dfs, ignore_index=True) | ||
|
||
return result | ||
|
||
if __name__ == "__main__": | ||
# Set up argparse to accept command-line arguments | ||
parser = argparse.ArgumentParser(description='Concatenate files in the current directory.') | ||
parser.add_argument('--dir', type=str, default='./', help='Directory to search for files (default: current directory)') | ||
parser.add_argument('--pattern', type=str, help='Pattern to match filenames') | ||
parser.add_argument('--output', type=str, default='out.tsv', help='Output filename') | ||
|
||
# Parse the command-line arguments | ||
args = parser.parse_args() | ||
|
||
# Call the function to concatenate files with the specified pattern | ||
concatenated_df = concat_files(args.dir, args.pattern) | ||
|
||
# Save the concatenated DataFrame to a CSV file | ||
concatenated_df.to_csv(args.output, index=False, sep="\t", na_rep='NA') |
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
Oops, something went wrong.