Skip to content

Commit

Permalink
added N extention to UMI if too short with option -l for UmiAwareMark…
Browse files Browse the repository at this point in the history
…DuplicatesWithMateCigar
  • Loading branch information
mmterpstra committed Jul 21, 2017
1 parent f235486 commit 1e5fa92
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
36 changes: 36 additions & 0 deletions eb/DigitalBarcodeReadgroups-0.1.10-foss-2016a-Perl-5.20.2-bare.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
easyblock = 'Tarball'

name = 'DigitalBarcodeReadgroups'
version = '0.1.10'

homepage = 'https://github.com/mmterpstra/%s' % (name)
description = """Misc tools"""

toolchain = {'name': 'foss', 'version': '2016a'}

source_urls = [('https://github.com/mmterpstra/%s/archive/' % (name) )]
sources = [ '%s.tar.gz' % version ]

perl = 'Perl'
perlver = '5.20.2'
perlversuffix = '-bare'
versionsuffix = '-%s-%s%s' % (perl, perlver, perlversuffix)

samtools='SAMtools'
samtoolsver='1.3'

dependencies = [
(perl, perlver, perlversuffix),
(samtools, samtoolsver),
]

#
# Check if all binaries are present.
#

sanity_check_paths = {
'files': [ 'src/NugeneDigitalSplitter.pl', 'src/NugeneMergeFastqFiles.pl' ],
'dirs': [ 'src/' ],
}

moduleclass = 'bio'
10 changes: 7 additions & 3 deletions src/NugeneDigitalSplitter.pl
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ sub ApplyPicardTag {
@{$sam} = split("\t",$line);
#my $rgID = SamGetReadGroupID($sam);
my $randombc = SamGetRandombc($sam);

$sam = SamRemoveRandombc($sam);
$line = SamAsString($sam);

$randombc = substr($randombc,0,$opts -> {'l'}) if(defined($opts -> {'l'}) && $opts -> {'l'} > 0);
$sam = SamRemoveRandombc($sam);
$line = SamAsString($sam);
#a
#
$randombc = $randombc .'N' x ($opts -> {'l'} - length($randombc)) if(defined($opts -> {'l'}) && $opts -> {'l'} > 0 && length($randombc) < $opts -> {'l'});

$line .= "\t$tag:Z:$randombc";
#die "$line";
print $out $line."\n";
Expand Down

0 comments on commit 1e5fa92

Please sign in to comment.