Skip to content

Commit

Permalink
Make the minimum number of matches required for a valid read-contig o…
Browse files Browse the repository at this point in the history
…verlap an option
  • Loading branch information
mourisl committed Dec 12, 2022
1 parent 83a632d commit 8e5515d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ TRUST4 is also available form [Bioconda](https://anaconda.org/bioconda/trust4).
--UMI STRING: if -b, bam field for UMI; if -1 -2/-u, file containing UMIs (default: not used)
--umiRange INT INT CHAR: start, end(-1 for lenght-1), strand in a UMI is the true UMI (default: 0 -1 +)
--barcode-level STRING: barcode is for cell or molecule (default: cell)
--minHitLen INT: the minimal hit length for a valid overlap (default: auto)
--mateIdSuffixLen INT: the suffix length in read id for mate. (default: not used)
--skipMateExtension: do not extend assemblies with mate information, useful for SMART-seq (default: not used)
--abnormalUnmapFlag: the flag in BAM for the unmapped read-pair is nonconcordant (default: not set)
Expand Down
12 changes: 12 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ char usage[] = "./trust4 [OPTIONS]:\n"
"\t-t INT: number of threads (default: 1)\n"
"\t-c STRING: the path to the kmer count file\n"
"\t-k INT: the starting k-mer size for indexing contigs (default: 9)\n"
"\t--minHitLen INT: the minimal hit length for a valid overlap (default: auto)\n"
"\t--skipMateExtension: skip the step of extension assemblies with mate-pair information\n"
///"\t--noV: do not assemble the full length V gene (default: not used)\n"
"\t--trimLevel INT: 0: no trim; 1: trim low quality; 2: trim unmatched (default: 1)\n"
Expand All @@ -50,6 +51,7 @@ static struct option long_options[] = {
{ "keepNoBarcode", no_argument, 0, 10003 },
{ "UMI", required_argument, 0, 10004},
{ "skipMateExtension", no_argument, 0, 10005},
{ "minHitLen", required_argument, 0, 10006},
{ (char *)0, 0, 0, 0}
} ;

Expand Down Expand Up @@ -227,6 +229,7 @@ int main( int argc, char *argv[] )
int maxReadLen = -1 ;
int firstReadLen = -1 ;
int trimLevel = 1 ;
int minHitLen = -1 ;
bool hasMate = false ;
bool hasBarcode = false ;
bool hasUmi = false ;
Expand Down Expand Up @@ -306,6 +309,10 @@ int main( int argc, char *argv[] )
{
skipMateExtension = true ;
}
else if ( c == 10006 ) // minHitLen
{
minHitLen = atoi( optarg ) ;
}
else
{
fprintf( stderr, "%s", usage ) ;
Expand Down Expand Up @@ -1075,6 +1082,11 @@ int main( int argc, char *argv[] )
else
seqSet.SetHitLenRequired( 17 ) ;
}

if (minHitLen != -1)
{
seqSet.SetHitLenRequired( minHitLen ) ;
}

if ( firstReadLen > 200 || trimLevel > 1 )
changeKmerLengthThreshold /= 2 ;
Expand Down
8 changes: 7 additions & 1 deletion run-trust4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use Cwd 'cwd' ;
use Cwd 'abs_path' ;
use File::Basename ;

die "TRUST4 v1.0.8-r425 usage: ./run-trust4 [OPTIONS]:\n".
die "TRUST4 v1.0.8-r426 usage: ./run-trust4 [OPTIONS]:\n".
"Required:\n".
#"\t[Input]:\n".
"\t-b STRING: path to bam file\n".
Expand All @@ -29,6 +29,7 @@ die "TRUST4 v1.0.8-r425 usage: ./run-trust4 [OPTIONS]:\n".
"\t--UMI STRING: if -b, bam field for UMI; if -1 -2/-u, file containing UMIs (default: not used)\n".
"\t--umiRange INT INT CHAR: start, end(-1 for lenght-1), strand in a UMI is the true UMI (default: 0 -1 +)\n".
"\t--barcodeLevel STRING: barcode is for cell or molecule (default: cell)".
"\t--minHitLen INT: the minimal hit length for a valid overlap (default: auto)\n".
"\t--mateIdSuffixLen INT: the suffix length in read id for mate. (default: not used)\n".
"\t--skipMateExtension: do not extend assemblies with mate information, useful for SMART-seq (default: not used)\n".
"\t--abnormalUnmapFlag: the flag in BAM for the unmapped read-pair is nonconcordant (default: not set)\n".
Expand Down Expand Up @@ -238,6 +239,11 @@ for ( $i = 0 ; $i < @ARGV ; ++$i )

$i += 3 ;
}
elsif ( $ARGV[$i] eq "--minHitLen" )
{
$mainArgs .= " ".$ARGV[$i]." ".$ARGV[$i + 1] ;
++$i ;
}
elsif ( $ARGV[$i] eq "--outputReadAssignment" )
{
$outputReadAssignment = 1 ;
Expand Down

0 comments on commit 8e5515d

Please sign in to comment.