Repository revision
10:a535cf1e5da4

Repository 'umi_tools_count'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count

UMI-tools count tool metadata
Miscellaneous
performs quantification of UMIs from BAM files
umi_tools_count
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/1.1.2+galaxy2
1.1.2+galaxy2
None
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/1.1.2+galaxy2 (this tool)
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/1.1.2+galaxy1
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/1.1.2+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/0.5.5.1
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/0.5.5.0
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/0.5.3.2
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/0.5.3.1
toolshed.g2.bx.psu.edu/repos/iuc/umi_tools_count/umi_tools_count/0.5.3.0
umi_tools_count
Requirements (dependencies defined in the <requirements> tag set)
name version type
umi_tools 1.1.2 package
samtools 1.12 package
sed 4.7 package
Additional information about this tool
#import re
        
        #if $input.is_of_type("sam"):
            ## TODO dedup has problems with SAM input in some cases
            ## https://github.com/CGATOxford/UMI-tools/issues/483
            ## so convert it to sorted BAM for now
            ## #set $input_file = $input
            samtools sort --no-PG '$input' > 'input.bam' &&
            samtools index -b 'input.bam' &&
            #set $input_file = 'input.bam'
        #else:
            ln -sf '${input}' 'input.bam' &&
            ln -sf '$input.metadata.bam_index' 'input.bam.bai' &&
            #set $input_file = 'input.bam'
        #end if
            

        umi_tools count
            '$wide_format_cell_counts'
            
        --extract-umi-method $bc.extract_umi_method
        #if str($bc.extract_umi_method) == 'read_id':
            --umi-separator '$bc.umi_separator'
        #else if str($bc.extract_umi_method) == 'tag':
            --umi-tag '$bc.umi_tag'
            #if $bc.umi_tag_split != ''
                --umi-tag-split '$bc.umi_tag_split'
            #end if
            #if $bc.umi_tag_delimiter != ''
                --umi-tag-delimiter '$bc.umi_tag_delimiter'
            #end if
            --cell-tag '$bc.cell_tag'
            #if $bc.cell_tag_split != ''
                --cell-tag-split '$bc.cell_tag_split'
            #end if
            #if $bc.cell_tag_delimiter != ''
                --cell-tag-delimiter '$bc.cell_tag_delimiter'
            #end if
        #end if
    
            
        --method $umi.method
        --edit-distance-threshold $umi.edit_distance_threshold
        $umi.spliced_is_unique
        --soft-clip-threshold $umi.soft_clip_threshold
        $umi.read_length
    
            
            #if str($sc.gene_tag) != "":
                --gene-tag '$sc.gene_tag'
            #end if
            #if str($sc.assigned_status_tag) != "":
                --assigned-status-tag '$sc.assigned_status_tag'
            #end if
            #if str($sc.skip_tags_regex) != "":
                --skip-tags-regex '$sc.skip_tags_regex'
            #end if
            $sc.per_contig
            #if $sc.gene_transcript_map:
                --gene-transcript-map '$sc.gene_transcript_map'
            #end if
            $sc.per_cell
    
            
        --mapping-quality $sambam.mapping_quality
        --unmapped-reads $sambam.unmapped_reads
        #if $sambam.chimeric_pairs
            --chimeric-pairs $sambam.chimeric_pairs
        #end if
        #if $sambam.unpaired_reads
            --unpaired-reads $sambam.unpaired_reads
        #end if
        $sambam.ignore_umi
        $sambam.ignore_tlen
        #if str($sambam.chrom) != ''
            --chrom '$sambam.chrom'
        #end if
        --subset $sambam.subset
        $sambam.paired
        
        ## TODO see comment in LINK_SAM_BAM_INPUT
        ## #if $input.is_of_type("sam"):
        ##     --in-sam
        ## #end if
    
    
            
        #if str($advanced.random_seed) != ''
            --random-seed='$advanced.random_seed'
        #end if
    
            -I '$input_file' -S '$out_counts'
            
        #if $log:
            --log='$out_log'
        #end if
        --log2stderr
    
        #if str($cond_extra.prepender) != "none":
            #if str($cond_extra.prepender) == "string":
                #set $replacer = str($cond_extra.custom_label)
            #else
                #set $replacer = re.sub('[^\w\_]+', '_', str($input.element_identifier.rsplit('.',1)[0]))
            #end if
            && sed -i -r '1s|\b([ACGT]+)\b|'"$replacer"'_\1|g' '$out_counts'
        #end if
    
None
False
Functional tests
name inputs outputs required files
Test-1 input: chr19_gene_tags.bam
wide_format_cell_counts: False
bc|extract_umi_method: umis
umi|method: directional
sc|gene_tag: XF
sc|skip_tags_regex: ^[__|Unassigned]
sc|per_cell: False
advanced|random_seed: 123456789
name: value
chr19_gene_tags.bam
value
Test-2 input: chr19_gene_tags.sam
wide_format_cell_counts: False
bc|extract_umi_method: umis
umi|method: directional
sc|gene_tag: XF
sc|skip_tags_regex: ^[__|Unassigned]
sc|per_cell: False
advanced|random_seed: 123456789
name: value
chr19_gene_tags.sam
value
Test-3 input: chr19_gene_tags.bam
wide_format_cell_counts: False
bc|extract_umi_method: umis
umi|method: directional
sc|gene_tag: XF
sc|skip_tags_regex: ^[__|Unassigned]
sc|per_cell: True
advanced|random_seed: 123456789
name: value
chr19_gene_tags.bam
value
Test-4 input: chr19_gene_tags.bam
wide_format_cell_counts: True
bc|extract_umi_method: umis
umi|method: directional
sc|gene_tag: XF
sc|skip_tags_regex: ^[__|Unassigned]
sc|per_cell: True
advanced|random_seed: 123456789
name: value
chr19_gene_tags.bam
value
Test-5 input: fc.ENSDARG00000019692.bam
umi|method: unique
sc|gene_tag: XT
sc|per_cell: True
advanced|random_seed: 0
name: value
fc.ENSDARG00000019692.bam
value
Test-6 input: fc.ENSDARG00000019692.bam
umi|method: unique
sc|gene_tag: XT
sc|per_cell: True
advanced|random_seed: 0
cond_extra|custom_label: test
cond_extra|prepender: string
name: value
fc.ENSDARG00000019692.bam
value
Test-7 input: fc.ENSDARG00000019692.bam
umi|method: unique
sc|gene_tag: XT
sc|per_cell: True
advanced|random_seed: 0
cond_extra|prepender: dataset name
name: value
fc.ENSDARG00000019692.bam
value