SBIMB / StellarPGx

Calling star alleles in highly polymorphic pharmacogenes (e.g. CYP450 genes) by leveraging genome graph-based variant detection.
MIT License
30 stars 7 forks source link

/path/to error: while mounting /path/to: mount source /path/to doesn't exist #31

Closed roofya closed 10 months ago

roofya commented 1 year ago

Dear StellarPGx,

I'm applying your pipeline for using in pharmcat and I got this error message. im running it through our cluster. Please advise how I can fix this problem.

this is the command

NXF_VER=22.10.8 nextflow run main.nf -profile standard --in_bam input.bam --out_dir stellarpgx_results

Nextflow 23.10.0 is available - Please consider updating your version to it N E X T F L O W ~ version 22.10.8 Launching main.nf [soggy_mcnulty] DSL1 - revision: 8b63cf48c8 executor > local (5) executor > local (5) [c3/fbb93c] process > call_snvs1 (1) [100%] 1 of 1, failed: 1 ✘ [6b/c3655f] process > call_snvs2 (1) [100%] 1 of 1, failed: 1 ✘ [a4/c949ce] process > call_sv_del (1) [200%] 2 of 1, failed: 2 ✘ [5a/0921ce] process > call_sv_dup (1) [100%] 1 of 1, failed: 1 ✘ [47/3565d8] process > get_depth (1) [100%] 1 of 1, failed: 1 ✘ [- ] process > format_snvs - [- ] process > get_core_var - [- ] process > analyse_1 - [- ] process > analyse_2 - [- ] process > analyse_3 - [- ] process > call_stars - Error executing process > 'call_snvs2 (1)'

Caused by: Process call_snvs2 (1) terminated with an error exit status (255)

Command executed:

graphtyper genotype reference/genome --sam=Pgx001_S4.bam --sams_index=<(echo Pgx001_S4.bam.bai) --region=chr22:42126000-42137500 --output=Pgx001_S4_var_2 -a --minimum_extract_score_over_homref=0
bcftools concat Pgx001_S4_var_2/chr22/*.vcf.gz > Pgx001_S4_var_2/chr22/042126000-042137500.vcf
bgzip -f Pgx001_S4_var_2/chr22/042126000-042137500.vcf tabix -f Pgx001_S4_var_2/chr22/042126000-042137500.vcf.gz

Command exit status: 255

Command output: (empty)

Command error: WARNING: skipping mount of /path/to: stat /path/to: no such file or directory .command.sh: line 2: graphtyper: command not found INFO: Cleanup error: while unmounting /var/apptainer/mnt/session/final directory: device or resource busy FATAL: container creation failed: mount hook function failure: mount /path/to->/path/to error: while mounting /path/to: mount source /path/to doesn't exist

Work dir: /local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/StellarPGx/work/6b/c3655f4dbef3ed20bdd1d10030bfc9

Tip: you can replicate the issue by changing to the process work dir and entering the command bash .command.run

twesigomwedavid commented 1 year ago

@roofya,

Thanks for raising this. I think it could be something to do with the params you supplied on your system. Could you share with me your nextflow.config file?

Thanks

roofya commented 1 year ago

Thanks for quick reply, Here is the nectflow.config

manifest { author = 'David Twesigomwe' description = 'Pipeline calls CYP450 star alleles from WGS BAM/CRAM files. Model gene: CYP2D6' mainScript = 'main.nf' version = '1.2.6' }

params { // User-defined parameters

// reference genome ref_file = "/path/to/reference/genome" // .fai index should be in the same folder

// BAM/CRAM file(s) and respective indexes // example1 (single sample): /path/to/data/GeT-RM/NA12878{bam,bai} // example2 (multiple samples): /path/to/data/GeT-RM/{bam,bai} // example3 (CRAM files): /path/to/data/GeT-RM/HG*{cram,crai}

in_bam = "/path/to/Sample*{bam,bai}"

// Output directoy (Default is $PWD/results). User-defined path should be an absolute path out_dir = "$PWD/results"

// DO NOT modify these lines
gene = "cyp2d6" db_init = "$PWD/database" res_init = "$PWD/resources" caller_init = "$PWD/scripts"

}

singularity { enabled = true // set to false when using Docker autoMounts = true cacheDir = "$PWD/containers" runOptions = " --cleanenv" }

// To use Docker, set "enabled" to "true" and do the opposite to the singularity config above. Also remember to change the container path in the process config below to point to the Docker container rather than Singularity.

docker { enabled = false // change to true when using Docker runOptions = '-u \$(id -u):\$(id -g)' }

process {

// ALL PROCESSES
cache = true
stageInMode = 'symlink'
stageOutMode = 'rsync'

// scratch = "$HOME/tmp" // clean this regularly

// Containers

// Singularity
container = "$PWD/containers/stellarpgx-dev.sif"

// Docker
// container = "twesigomwedavid/stellarpgx-dev:latest" // Note that this Docker build needs to be pulled from Docker Hub

}

profiles {

// Local machine (MacOS, Linux, cluster node etc)
standard { 
    process.executor = 'local'
}

// SLURM scheduler
slurm { 
    process.executor = 'slurm'
    process.queue = 'batch'
} 

// Other scheduler
// sheduler_name {
//  process.executor = 'sheduler_name'
//  process.queue = 'batch'
//}

test { includeConfig "$PWD/tests/config/test.config" }

nat2_call { includeConfig "$PWD/tests/config/nat2.config" }

}

twesigomwedavid commented 1 year ago

@roofya,

thanks. you can see that you have not provided the custom paths to the reference genome and the input bam file(s). The current paths which are there (ref_file = "/path/to/reference/genome" and in_bam = "/path/to/Sample*{bam,bai}") are placeholders

roofya commented 1 year ago

@twesigomwedavid

Thanks for your help,

I have put the path for ref and bam file but still I got another error :( (nextflow) [mr2329@cbsurf02 StellarPGx]$ NXF_VER=22.10.8 nextflow run main.nf -profile standard --out_dir ../stellarpgx_results Nextflow 23.10.0 is available - Please consider updating your version to it N E X T F L O W ~ version 22.10.8 Launching main.nf [elegant_austin] DSL1 - revision: 8b63cf48c8 executor > local (5) executor > local (5) [- ] process > call_snvs1 (1) - [- ] process > call_snvs2 (1) - [- ] process > call_sv_del (1) - [- ] process > call_sv_dup (1) - [0f/54f198] process > get_depth (1) [100%] 1 of 1, failed: 1 ✘ [- ] process > format_snvs - [- ] process > get_core_var - [- ] process > analyse_1 - [- ] process > analyse_2 - [- ] process > analyse_3 - [- ] process > call_stars - Error executing process > 'get_depth (1)'

Caused by: Process get_depth (1) terminated with an error exit status (2)

Command executed:

samtools bedcov --reference GRCh38.p13/GRCh38.primary_assembly.genome.fa res_hg38/test3.bed Pgx001_S4.bam > Pgx001_S4_cyp2d6_ctrl.depth

Command exit status: 2

Command output: (empty)

Command error: [E::idx_find_and_load] Could not retrieve index file for 'Pgx001_S4.bam' ERROR: fail to open index BAM file 'Pgx001_S4.bam'

Work dir: /local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/StellarPGx/work/0f/54f198f938762e799b1bc024ce904b

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named .command.sh

twesigomwedavid commented 1 year ago

@roofya, Could you send me your updated nextflow.config file please?

Thanks

roofya commented 1 year ago

manifest { author = 'David Twesigomwe' description = 'Pipeline calls CYP450 star alleles from WGS BAM/CRAM files. Model gene: CYP2D6' mainScript = 'main.nf' version = '1.2.6' }

params { // User-defined parameters

// reference genome ref_file = "/local/storage/refGenome/GRCh38.p13/GRCh38.primary_assembly.genome.fa" // .fai index should be in the same folder

// BAM/CRAM file(s) and respective indexes // example1 (single sample): /path/to/data/GeT-RM/NA12878{bam,bai} // example2 (multiple samples): /path/to/data/GeT-RM/{bam,bai} // example3 (CRAM files): /path/to/data/GeT-RM/HG*{cram,crai}

in_bam = "/local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/Pgx001_S4.bam"

// Output directoy (Default is $PWD/results). User-defined path should be an absolute path out_dir = "$PWD/results"

// DO NOT modify these lines
gene = "cyp2d6" db_init = "$PWD/database" res_init = "$PWD/resources" caller_init = "$PWD/scripts"

}

singularity { enabled = true // set to false when using Docker autoMounts = true cacheDir = "$PWD/containers" runOptions = " --cleanenv" }

// To use Docker, set "enabled" to "true" and do the opposite to the singularity config above. Also remember to change the container path in the process config below to point to the Docker container rather than Singularity.

docker { enabled = false // change to true when using Docker runOptions = '-u \$(id -u):\$(id -g)' }

process {

// ALL PROCESSES
cache = true
stageInMode = 'symlink'
stageOutMode = 'rsync'

// scratch = "$HOME/tmp" // clean this regularly

// Containers

// Singularity
container = "$PWD/containers/stellarpgx-dev.sif"

// Docker
// container = "twesigomwedavid/stellarpgx-dev:latest" // Note that this Docker build needs to be pulled from Docker Hub

}

roofya commented 1 year ago

I figured it out I should put bam file in this format"/local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/Pgx001_S4*{bam,bai}"

Thankssssss

twesigomwedavid commented 1 year ago

@roofya,

Kindly modify the in_bam parameter to the following:

in_bam = "/local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/Pgx001_S4*{bam,bai}"

If you're supplying multiple samples, then this should be written as:

in_bam = "/local/storage/Precision_Pharmacogenomics/WGS/Robay_Crystal/PharmCAT/*{bam,bai}"

roofya commented 1 year ago

@twesigomwedavid

Thank you so much, now I got output for cyp2d6 and its a folder with two subfolders with variants and allele, but in the pharmcat tutorial the expected output After running StellarPGx with CYP2D6 as the target gene, it should produce a _summary.txt

Please advise how I can get the summary.txt file

Thanks

roofya commented 1 year ago

@twesigomwedavid

Am i correct, I think its the results part from this allele

CYP2D6 Star Allele Calling with StellarPGx


Initially computed CN = 2

Sample core variants: 42126611~C>G~0/1;42127526~C>T~0/1;42128945~C>T~0/1;42129809~T>C~0/1;42129819~G>T~0/1;42130692~G>A~0/1

Candidate alleles: ['139.v1_4.v1', '1.v1_4.v7', '4.v13_74.v1']

Result: 1/4

Activity score: 1.0

Metaboliser status: Intermediate metaboliser (IM)

twesigomwedavid commented 1 year ago

@roofya, I have not worked with PharmCAT extensively. But I believe some simple Bash scripting (or even a one-line command) could get you a summary that you can supply to PharmCAT.

Yes, according to your current StellarPGx run, this participant has CYP2D61/4

Perhaps you can send me an example summary file that you've used before as input to PharmCAT. Then we can see how to modify the StellarPGx output to fit that.

roofya commented 1 year ago

@twesigomwedavid

Thank you so much for all your help. PharmCAT format is something like that CYP2D6 71/2x2

I can easily extract this information :)

twesigomwedavid commented 1 year ago

Yes, so depending on how many samples you have, you can run the (https://github.com/SBIMB/StellarPGx/blob/master/scripts/general/get_results_summary.sh) script -- this requires a samples list and an output file as options and should be run in the ./alleles folder created by StellarPGx.

bash get_results_summary.sh -s samples.list -o results.txt

the afterwards, you can just add a column with CYP2D6

sed 's/^/CYP2D6/' results.txt > results_mod.txt

roofya commented 1 year ago

@twesigomwedavid

Thanks again for all your help. I have a question if I would like to know about a list of genes how I can put it in the commands,

roofya commented 1 year ago

@twesigomwedavid

I think I should do it one by one for each gene NXF_VER=22.10.8 nextflow run main.nf -profile standard --out_dir ../stellarpgx_res --gene cyp2c9

twesigomwedavid commented 1 year ago

@roofya,

Yes, currently the tool is set to run on each gene individually