nloyfer / wgbs_tools

tools for working with Bisulfite Sequencing data while preserving reads intrinsic dependencies
Other
125 stars 33 forks source link

OSError: [Errno 22] while bam2pat #47

Closed vinodsinghjnu closed 10 months ago

vinodsinghjnu commented 10 months ago

Hi I am having a strange problem while running bam2pat on the tutorial data

(ngs_packages) [vin@fe-open-01 wgbs_tools]$ wgbstools bam2pat tutorial/bams/Sigmoid_Colon_STL003.small.bam 
Traceback (most recent call last):
  File "/home/vin/wgbs_tools/wgbstools", line 97, in <module>
    main()
  File "/home/vin/wgbs_tools/wgbstools", line 64, in main
    importlib.import_module(args.command).main()
  File "/home/vin/wgbs_tools/src/python/bam2pat.py", line 429, in main
    Bam2Pat(args, bam)
  File "/home/vin/wgbs_tools/src/python/bam2pat.py", line 192, in __init__
    self.gr = GenomicRegion(args)
  File "/home/vin/wgbs_tools/src/python/genomic_region.py", line 28, in __init__
    self.genome_name = get_genome_name(genome_name)
  File "/home/vin/wgbs_tools/src/python/genomic_region.py", line 21, in get_genome_name
    return os.readlink(refdir)
OSError: [Errno 22] Invalid argument: '/home/vin/wgbs_tools/references/default'

(ngs_packages) [vin@fe-open-01 wgbs_tools]$ tree -C -L 2
.
├── Dockerfile
├── docs
│   ├── beta_format.md
│   ├── img
│   ├── init_genome_ref_wgbs.md
│   ├── pat_format.md
│   ├── README.md
│   └── view.md
├── LICENSE.md
├── poetry.lock
├── pyproject.toml
├── README.md
├── references
│   ├── default
│   ├── hg19
│   └── hg38
├── setup.py
├── src
│   ├── collapse_pat.pl
│   ├── cpg2bed
│   ├── cview
│   ├── homog
│   ├── __init__.py
│   ├── pat2beta
│   ├── pat_sampler
│   ├── pipeline_wgbs
│   ├── __pycache__
│   ├── python
│   ├── segment_betas
│   ├── view_beta.sh
│   └── view_lbeta.sh
├── supplemental
│   ├── find_markers_config.txt
│   ├── find_markers_defaults.txt
│   ├── hg19.annotations.bed.gz
│   ├── hg19.annotations.bed.gz.tbi
│   ├── hg19.ilmn2CpG.tsv.gz
│   └── hg38.ilmn2CpG.tsv.gz
├── tutorial
│   ├── bams
│   ├── images
│   └── README.md
└── wgbstools -> src/python/wgbs_tools.py
nloyfer commented 10 months ago

Seems like the init_genome command wasn't completed properly. The /home/vin/wgbs_tools/references/default directory should be a symbolic link pointing to one of your reference genome directories (e.g. hg19). Did you run wgbstools init_genome, and did it return with no errors? I would also try running wgbstools set_default_ref hg19

vinodsinghjnu commented 10 months ago

Seems like the init_genome command wasn't completed properly. The /home/vin/wgbs_tools/references/default directory should be a symbolic link pointing to one of your reference genome directories (e.g. hg19). Did you run wgbstools init_genome, and did it return with no errors? I would also try running wgbstools set_default_ref hg19

Thank you Nloyfer for the reply, I figured out the problem I was using samtools 1.2 which was not supporting the multithreaded command "bgzip -@ 36 -f ..." . So it was showing an error while executing "wgbstools init_genome" command