Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --platypus option to PMDtools #349

Open
jfy133 opened this issue Feb 10, 2020 · 8 comments · Fixed by #708
Open

Add --platypus option to PMDtools #349

jfy133 opened this issue Feb 10, 2020 · 8 comments · Fixed by #708
Assignees
Labels
help wanted Extra attention is needed needs upstream fix Needs a fix in the upstream tool project partially-fixed pending Addressed on branch waiting for related PR

Comments

@jfy133
Copy link
Member

jfy133 commented Feb 10, 2020

Is your feature request related to a problem? Please describe.

@pontussk suggests including the possibility for users to run PMDtools with the following flag --platypus. This is apparently used for mammals nDNA, as CpG cytosines are not affected by UDG treatment (and you can use it to see damage patterns still in UDG treatment, when using alongside --deamination!).

he also recommends including --first and --CpG

I will add those flags and maybe ask him to contribute some documentation (or 'recommendations' when to use those flags).

@jfy133 jfy133 self-assigned this Feb 10, 2020
@jfy133
Copy link
Member Author

jfy133 commented Feb 10, 2020

Note --CpG is already implemented in

eager/main.nf

Line 1610 in da407f8

def treatment = params.pmd_udg_type ? (params.pmd_udg_type =='half' ? '--UDGhalf' : '--CpG') : '--UDGminus'
where it is always selected if UDG type is either 'full'. If UDG is set to 'half' the --UDGhalf parameter is used instead.

--deamination is already automatically added in with

eager/main.nf

Line 1623 in da407f8

samtools calmd -b $bam $fasta | samtools view -h - | pmdtools --deamination --range ${params.pmdtools_range} $treatment $snpcap -n ${params.pmdtools_max_reads} > "${bam.baseName}".cpg.range."${params.pmdtools_range}".txt

So I will just add --first and --platypus

@apeltzer
Copy link
Member

Thanks for investigating this!

@jfy133 jfy133 mentioned this issue Feb 13, 2020
8 tasks
@jfy133 jfy133 linked a pull request Feb 13, 2020 that will close this issue
8 tasks
@jfy133 jfy133 added this to the V2.2 "Ulm" milestone Feb 21, 2020
@jfy133 jfy133 modified the milestones: V2.2 "Ulm", V2.3 "Wangen" May 14, 2020
@jfy133 jfy133 added the help wanted Extra attention is needed label Jun 8, 2020
@TCLamnidis TCLamnidis self-assigned this Mar 22, 2021
@TCLamnidis
Copy link
Collaborator

Preparing a PR that will be adding the option to include --platypus to the command.

I cannot get --first to work. It seems that the latest pmdtools release lacks some code changes that let this option work as intended (at least within my limited tests).

tagged release code:
https://github.com/pontussk/PMDtools/blob/0.60/pmdtools.0.60.py#L1074-L1082

vs
code at master (cc91fb8)
https://github.com/pontussk/PMDtools/blob/master/pmdtools.0.60.py#L1075-L1081

I suspect a new release will need to be pushed before --first can be implemented in eager.

@TCLamnidis TCLamnidis mentioned this issue Mar 22, 2021
4 tasks
@jfy133
Copy link
Member Author

jfy133 commented Mar 22, 2021

Can you make an issue on PMDtools to ask, and ref back here, so we can keep track of the convo?

@TCLamnidis TCLamnidis linked a pull request Mar 22, 2021 that will close this issue
4 tasks
@TCLamnidis
Copy link
Collaborator

pontussk/PMDtools#8

@TCLamnidis TCLamnidis added needs upstream fix Needs a fix in the upstream tool project pending Addressed on branch waiting for related PR partially-fixed labels Mar 22, 2021
@pontussk
Copy link

pontussk commented Mar 22, 2021 via email

@TCLamnidis
Copy link
Collaborator

Using Conda

$ conda create --name pmdtools pmdtools -c bioconda`
$ conda activate pmdtools
pmdtools v0.50
$ samtools calmd -b JK2067_rmdup.bam hs37d5.fa | samtools view -h - | pmdtools --deamination --first --platypus --range 10 --CpG  -n 10000 > "JK2067".cpg.range."10".1st.txt`

Traceback (most recent call last):
  File "/projects1/users/lamnidis/miniconda3/envs/pmdtools/bin/pmdtools", line 1074, in <module>
    if n>0:
NameError: name 'n' is not defined
samtools view: writing to standard output failed: Broken pipe
samtools view: error closing standard output: -1
[E::bgzf_flush] File write failed (wrong size)
samtools calmd: failed to write to output file: Broken pipe
[E::bgzf_close] File write failed

Master branch (cc91fb8)

$ cd ~/Software/
$ git clone git@github.com:pontussk/PMDtools.git
$ python2 ~/Software/PMDtools/pmdtools.0.60.py --version

pmdtools.0.60.py v0.50
$ cd -
$ samtools calmd -b JK2067_rmdup.bam hs37d5.fa | samtools view -h - | python2 ~/Software/PMDtools/pmdtools.0.60.py --deamination --first --platypus --range 10 --CpG  -n 10000 > "JK2067".cpg.range."10".1st.github.txt

samtools view: writing to standard output failed: Broken pipe
samtools view: error closing standard output: -1
[bam_fillmd1] different MD for read 'K00233:65:HKTTVBBXX:6:2119:1387:28446': '30^T24' -> '30^N24'
[bam_fillmd1] different MD for read 'K00233:65:HKTTVBBXX:5:1112:4066:2070': '0A0C0T53' -> '0A0C0N53'

The latter command provides a valid output file, but the former does not.

$ ls -l 

-rw-r--r-- 1 lamnidis domain users 4.2K Mar 24 19:12 JK2067.cpg.range.10.1st.github.txt
-rw-r--r-- 1 lamnidis domain users    0 Mar 24 19:05 JK2067.cpg.range.10.1st.txt

I attach the bam and bai used above. Archive.zip

@apeltzer
Copy link
Member

So the pipeline is able to do it, once the PMDTools tool / recipe is fixed this is runnable 👍🏻

@jfy133 jfy133 mentioned this issue Apr 6, 2021
11 tasks
@jfy133 jfy133 removed this from the 2.4 "Wangen" milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs upstream fix Needs a fix in the upstream tool project partially-fixed pending Addressed on branch waiting for related PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants