Skip to content

Commit

Permalink
Merge pull request #122 from nf-core/discovery-splitup
Browse files Browse the repository at this point in the history
Simplify circrna_discovery subworkflow
  • Loading branch information
nictru committed May 28, 2024
2 parents 74dfdf6 + f351b96 commit 5ef923d
Show file tree
Hide file tree
Showing 25 changed files with 564 additions and 577 deletions.
File renamed without changes.
11 changes: 3 additions & 8 deletions bin/merge_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@

args = parser.parse_args()

columns = ['chr', 'start', 'end', 'strand', 'count']
columns = ['chr', 'start', 'end', 'name', 'count', 'strand']
dfs = [pd.read_csv(bed, sep='\t', header=None, names=columns) for bed in args.beds]
df = pd.concat(dfs)

df['tool_count'] = 1

df = df.groupby(['chr', 'start', 'end', 'strand']).agg({'count': args.duplicates_fun,
df = df.groupby(['chr', 'start', 'end', 'strand', 'name']).agg({'count': args.duplicates_fun,
'tool_count': 'sum'}).reset_index()
df = df[df['tool_count'] >= args.tool_filter]

df.drop('tool_count', axis=1, inplace=True)
df["name"] = df["chr"] + ":" + df["start"].astype(str) + "-" + df["end"].astype(str) + ":" + df["strand"]

df = df[['chr', 'start', 'end', 'name', 'count', 'strand']]

df = df[columns]
df.to_csv(args.output, sep='\t', index=False, header=False)
183 changes: 95 additions & 88 deletions conf/modules.config

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions modules/local/circexplorer2/filter/main.nf

This file was deleted.

43 changes: 0 additions & 43 deletions modules/local/circrna_finder/filter/main.nf

This file was deleted.

34 changes: 34 additions & 0 deletions modules/local/circrna_finder/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
process CIRCRNA_FINDER {
tag "$meta.id"
label 'process_low'

conda "bioconda::circrna_finder=1.2"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/circrna_finder%3A1.2--pl5321hdfd78af_1' :
'biocontainers/circrna_finder:1.2--pl5321hdfd78af_1' }"

input:
tuple val(meta), path(star_input, stageAs: 'input/')

output:
tuple val(meta), path("${prefix}.filteredJunctions.bed"), emit: results
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = 'v1.2'
"""
postProcessStarAlignment.pl --starDir input/ --outDir ./
cat <<-END_VERSIONS > versions.yml
"${task.process}":
awk: \$(awk --version | head -n1 | cut -d' ' -f3 | sed 's/,//g' )
cat: \$(cat --version | head -n 1 | sed -e 's/cat (GNU coreutils) //')
circRNA_finder: $VERSION
END_VERSIONS
"""
}
43 changes: 0 additions & 43 deletions modules/local/ciriquant/filter/main.nf

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process COUNTS_COMBINED {
process MERGE_SAMPLES {
label "process_single"

conda "bioconda::pandas=1.5.2"
Expand All @@ -16,7 +16,7 @@ process COUNTS_COMBINED {

script:
"""
counts_combined.py --beds ${beds} --out_bed merged_counts.bed --out_tsv merged_counts.tsv
merge_samples.py --beds ${beds} --out_bed merged_counts.bed --out_tsv merged_counts.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
35 changes: 0 additions & 35 deletions modules/local/dcc/filter/main.nf

This file was deleted.

File renamed without changes.
42 changes: 0 additions & 42 deletions modules/local/find_circ/filter/main.nf

This file was deleted.

39 changes: 0 additions & 39 deletions modules/local/segemehl/filter/main.nf

This file was deleted.

Loading

0 comments on commit 5ef923d

Please sign in to comment.