Skip to content

Commit

Permalink
pascal/main.nf edited to extract tarball as nextflow does not support…
Browse files Browse the repository at this point in the history
… s3 glob support
  • Loading branch information
wsjung committed Jan 23, 2024
1 parent 7be6ed2 commit 1e422f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
1 change: 0 additions & 1 deletion modules/local/mmap/mmap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ process MMAP {
path phenotype_file
path pedigree_file
path covariance_matrix_file
val output_dir

output:
path "*.poly.cov.csv" , emit: csv
Expand Down
13 changes: 1 addition & 12 deletions modules/local/pascal/bin/pascal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def pascal(gwas_file, manhattan_plot_file, gene_annotation, ref_panel, output_fi

#Load reference panel
Scorer.load_refpanel(ref_panel, qualityT = None, parallel = 1, keepfile=None)
#Scorer.load_refpanel(ref_panel, qualityT = None, parallel = 1, keepfile=None, chrlist=[22]) ## TESTING:: CHR22 ONLY FOR TESTING
# Scorer.load_refpanel(ref_panel, qualityT = None, parallel = 1, keepfile=None, chrlist=[1]) ## TESTING:: CHR22 ONLY FOR TESTING
print("Done importing reference panel")

# import and load genome annotation
Expand Down Expand Up @@ -52,19 +52,8 @@ def pascal(gwas_file, manhattan_plot_file, gene_annotation, ref_panel, output_fi
parser.add_argument('--output_file')

args = parser.parse_args()
#print(args)
pascal(gwas_file = args.gwas_file, manhattan_plot_file = args.manhattan_plot_file, gene_annotation = args.gene_annotation, ref_panel = args.ref_panel, output_file = args.output_file)

## test
#output_file = args.gwas_file
#manhattan_plot_file = os.path.splitext(args.gwas_file)[0] + "_mp.png"
# print(args.output_file)
# print(args.manhattan_plot_file)
# with open(args.output_file, "w") as f:
# f.write("this is the output file")
# with open(args.manhattan_plot_file, "w") as f:
# f.write("this is the manhattan plot file")

print("done")


Expand Down
21 changes: 12 additions & 9 deletions modules/local/pascal/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,35 @@ process PASCAL {
input:
path gwas_file
path gene_annotation
val ref_panel
val output_file
val manhattan_plot_file
path ref_panel

output:
path("${output_file}"), emit: tsv
path("${manhattan_plot_file}"), emit: manhattan
path("versions.yml"), emit: versions
path("pascal_out.tsv") , emit: tsv
path("manhattan_plot.png") , emit: manhattan
path("versions.yml") , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def ref_panel_name = ref_panel.getSimpleName() // get filename without ext

// TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10
// If the software is unable to output a version number on the command-line then it can be manually specified
// e.g. https://github.com/nf-core/modules/blob/master/modules/nf-core/homer/annotatepeaks/main.nf
// Each software used MUST provide the software name and version number in the YAML version file (versions.yml)

// extract tarball (nextflow does not support s3 glob)
"""
tar -xzvf ${ref_panel}
python3 ${moduleDir}/bin/pascal.py \\
--gwas_file $gwas_file \\
--gene_annotation $gene_annotation \\
--ref_panel $ref_panel \\
--manhattan_plot_file $manhattan_plot_file \\
--output_file $output_file
--ref_panel $ref_panel_name \\
--manhattan_plot_file manhattan_plot.png \\
--output_file pascal_out.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down

0 comments on commit 1e422f7

Please sign in to comment.