Skip to content

error in pepatac.py script  #299

@ASNbioinf

Description

@ASNbioinf
### Pipeline run code and environment:

*              Command:  `/my/path/pepatac/pipelines/pepatac.py -O /my/path/OUTPUT -P 10 --sample-name sample_S1_R1_001 --input /my/path/FastQ/sample_S1_R1_001.fastq.gz --genome hg38 --single-or-paired single --trimmer trimmomatic --aligner bwa --deduplicator picard --peak-caller macs3 -gs 2.7e9 --peak-type fixed --keep --prealignment-names rCRSd --prealignment-index rCRSd=/my/path/pepatac/genome_folder/default/94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4 --genome-index /my/path/pepatac/genome_folder/alias/hg38/bwa_index/default/hg38 --chrom-sizes /my/path/pepatac/genome_folder/hg38.chrom.sizes --TSS-name /my/path/pepatac/genome_folder/alias/hg38/refgene_anno/default/hg38_TSS.bed --blacklist /my/path/pepatac/genome_folder/hg38-blacklist.v2.bed --anno-name /my/path/pepatac/genome_folder/alias/hg38/feat_annotation/default/hg38_annotations.bed.gz`
*         Compute host:  10ea48504247
*          Working dir:  /data
*            Outfolder:  /my/path/OUTPUT/sample_S1_R1_001/
*  Pipeline started at:   (11-19 13:59:38) elapsed: 2.0 _TIME_

### Version log:

*       Python version:  3.8.10
*          Pypiper dir:  `/usr/local/lib/python3.8/dist-packages/pypiper`
*      Pypiper version:  0.12.1
*         Pipeline dir:  `/my/path/pepatac/pipelines`
*     Pipeline version:  0.11.3
*        Pipeline hash:  9ea1043cb2eba3194a30c0f759a7cc3316c8b139
*      Pipeline branch:  * master
*        Pipeline date:  2024-11-12 15:59:11 -0500
*        Pipeline diff:  3 files changed, 20 insertions(+), 82 deletions(-)

### Arguments passed to pipeline:

*           `TSS_name`:  `/my/path/pepatac/genome_folder/alias/hg38/refgene_anno/default/hg38_TSS.bed`
*            `aligner`:  `bwa`
*          `anno_name`:  `/my/path/pepatac/genome_folder/alias/hg38/feat_annotation/default/hg38_annotations.bed.gz`
*          `blacklist`:  `/my/path/pepatac/genome_folder/hg38-blacklist.v2.bed`
*        `chrom_sizes`:  `/my/path/pepatac/genome_folder/hg38.chrom.sizes`
*        `config_file`:  `pepatac.yaml`
*              `cores`:  `10`
*       `deduplicator`:  `picard`
*              `dirty`:  `False`
*             `extend`:  `250`
*              `fasta`:  `None`
*       `force_follow`:  `False`
*     `frip_ref_peaks`:  `None`
*    `genome_assembly`:  `hg38`
*       `genome_index`:  `/my/path/pepatac/genome_folder/alias/hg38/bwa_index/default/hg38`
*        `genome_size`:  `2.7e9`
*              `input`:  `['/my/path/FastQ/sample_S1_R1_001.fastq.gz']`
*             `input2`:  `None`
*               `keep`:  `True`
*               `lite`:  `False`
*             `logdev`:  `False`
*                `mem`:  `4000`
*              `motif`:  `False`
*          `new_start`:  `False`
*            `no_fifo`:  `False`
*           `no_scale`:  `False`
*      `output_parent`:  `/my/path/OUTPUT`
*         `paired_end`:  `False`
*        `peak_caller`:  `macs3`
*          `peak_type`:  `fixed`
* `prealignment_index`:  `['rCRSd=/my/path/pepatac/genome_folder/default/94e0d21feb576e6af61cd2a798ad30682ef2428bb7eabbb4']`
* `prealignment_names`:  `['rCRSd']`
*         `prioritize`:  `False`
*            `recover`:  `False`
*        `sample_name`:  `sample_S1_R1_001`
*        `search_file`:  `None`
*             `silent`:  `False`
*   `single_or_paired`:  `single`
*             `skipqc`:  `False`
*                `sob`:  `False`
*           `testmode`:  `False`
*            `trimmer`:  `trimmomatic`
*          `verbosity`:  `None`

----------------------------------------

Removed existing flag: '/my/path/OUTPUT/sample_S1_R1_001/PEPATAC_failed.flag'
Local input file: /my/path/FastQ/sample_S1_R1_001.fastq.gz

> `File_mb`	882	2	_RES_

> `Read_type`	single	PEPATAC	_RES_

> `Genome`	hg38	PEPATAC	_RES_

### Merge/link and fastq conversion:  (11-19 13:59:38) elapsed: 0.0 _TIME_

Number of input file sets: 1
Target exists: `/my/path/OUTPUT/sample_S1_R1_001/raw/sample_S1_R1_001.fastq.gz`  
Local input file: '/my/path/OUTPUT/sample_S1_R1_001/raw/sample_S1_R1_001.fastq.gz'
Found .fastq.gz file
Found .fq.gz file; no conversion necessary
Target exists: `/my/path/OUTPUT/sample_S1_R1_001/fastq/sample_S1_R1_001_R1.fastq.gz`  

### Adapter trimming:  (11-19 13:59:38) elapsed: 0.0 _TIME_

trimmomatic local_input_files: ['/my/path/OUTPUT/sample_S1_R1_001/raw/sample_S1_R1_001.fastq.gz']
Target exists: `/my/path/OUTPUT/sample_S1_R1_001/fastq/sample_S1_R1_001_R1_trim.fastq`  

### Prealignments (11-19 13:59:38) elapsed: 0.0 _TIME_


### Map to rCRSd (11-19 13:59:38) elapsed: 0.0 _TIME_

Traceback (most recent call last):
  File "/my/path/pepatac/pipelines/pepatac.py", line 2779, in <module>
    sys.exit(main())
  File "/my/path/pepatac/pipelines/pepatac.py", line 971, in main
    unmap_fq1, unmap_fq2 = _align(
  File "/my/path/pepatac/pipelines/pepatac.py", line 346, in _align
    pm.run(cmd, mapped_bam)
UnboundLocalError: local variable 'cmd' referenced before assignment
Starting cleanup: 3 files; 3 conditional files for cleanup

Cleaning up flagged intermediate files. . .

Conditional flag found: []

These conditional files were left in place:

- /my/path/OUTPUT/sample_S1_R1_001/fastq/sample_S1_R1_001*.fastq
- /my/path/OUTPUT/sample_S1_R1_001/fastq/*.fastq
- /my/path/OUTPUT/sample_S1_R1_001/fastq/*.log
- /my/path/OUTPUT/sample_S1_R1_001/prealignments/tmpk3rzkr2d
- /my/path/OUTPUT/sample_S1_R1_001/prealignments/sample_S1_R1_001_rCRSd_all.bam
- /my/path/OUTPUT/sample_S1_R1_001/prealignments/sample_S1_R1_001_rCRSd_unmapped.bam

### Pipeline failed at:  (11-19 13:59:38) elapsed: 0.0 _TIME_
Total time: 0:00:03
Failure reason: Pipeline failure. See details above.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pypiper/manager.py", line 1799, in _exit_handler
    self.fail_pipeline(Exception("Pipeline failure. See details above."))
  File "/usr/local/lib/python3.8/dist-packages/pypiper/manager.py", line 1660, in fail_pipeline
    raise exc
Exception: Pipeline failure. See details above.

I run PEPATAC in a container. The "UnboundLocalError: local variable 'cmd' referenced before assignment" indicates to change the assignment of the variable “cmd” in the pepatac.py script

Is there a correct version of this file pepatac.py???

To fix the second error "Error in atexit._run_exitfuncs" I tried to reinstall pypiper with the command "pip install pypiper" but the problem persists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-responseWaiting for response from original poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions