Skip to content

Commit

Permalink
1.2.25
Browse files Browse the repository at this point in the history
  • Loading branch information
hartleys committed Mar 5, 2017
1 parent 6ab8ad7 commit 648173c
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 18 deletions.
Binary file modified QoRTs-vignette.pdf
Binary file not shown.
Binary file modified QoRTs.jar
Binary file not shown.
Binary file removed QoRTs_1.2.19.tar.gz
Binary file not shown.
Binary file added QoRTs_1.2.25.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# QoRTs v1.2.19
(Compiled Fri Feb 17 13:51:51 EST 2017)
# QoRTs v1.2.25
(Compiled Sat Mar 4 13:22:59 EST 2017)

The [QoRTs software package](http://hartleys.github.io/QoRTs/) is a fast, efficient, and portable
multifunction toolkit designed to assist in
Expand Down
Binary file modified example-walkthrough.pdf
Binary file not shown.
180 changes: 180 additions & 0 deletions src/HartleyUtils/src/main/scala/internalUtils/commonSeqUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,190 @@ object commonSeqUtils {
s.map(reverseBaseCharMap(_));
}




/******************************************************************************************************
* Amino Acid Translation:
******************************************************************************************************/

val AMINO_ACID_CODON_MAP : scala.collection.immutable.Map[String,String] = scala.collection.immutable.Map[String,String](
("TTT","F"),
("TTC","F"),
("TTA","L"),
("TTG","L"),

("CTT","L"),
("CTC","L"),
("CTA","L"),
("CTG","L"),

("ATT","I"),
("ATC","I"),
("ATA","I"),
("ATG","M"),

("GTT","V"),
("GTC","V"),
("GTA","V"),
("GTG","V"),

("TCT","S"),
("TCC","S"),
("TCA","S"),
("TCG","S"),

("CCT","P"),
("CCC","P"),
("CCA","P"),
("CCG","P"),

("ACT","T"),
("ACC","T"),
("ACA","T"),
("ACG","T"),

("GCT","A"),
("GCC","A"),
("GCA","A"),
("GCG","A"),

("TAT","Y"),
("TAC","Y"),
("TAA","*"),
("TAG","*"),

("CAT","H"),
("CAC","H"),
("CAA","Q"),
("CAG","Q"),

("AAT","N"),
("AAC","N"),
("AAA","K"),
("AAG","K"),

("GAT","D"),
("GAC","D"),
("GAA","E"),
("GAG","E"),

("TGT","C"),
("TGC","C"),
("TGA","*"),
("TGG","W"),

("CGT","R"),
("CGC","R"),
("CGA","R"),
("CGG","R"),

("AGT","S"),
("AGC","S"),
("AGA","R"),
("AGG","R"),

("GGT","G"),
("GGC","G"),
("GGA","G"),
("GGG","G")
);

val AMINO_ACID_ABBRIV_MAP : Map[String,(String,String)] = Map[String,(String,String)](
("F",("Phe","Phenylalanine")),
("L",("Leu","Leucine")),
("I",("Ile","Isoleucine")),
("M",("Met","Methionine")),
("V",("Val","Valine")),
("S",("Ser","Serine")),
("P",("Pro","Proline")),
("T",("Thr","Threonine")),
("A",("Ala","Alanine")),
("Y",("Tyr","Tyrosine")),
("STOP",("STOP","STOP")),
("*",("Stp","STOP")),
("H",("His","Histidine")),
("Q",("Gln","Glutamine")),
("N",("Asn","Asparagine")),
("K",("Lys","Lysine")),
("D",("Asp","AsparticAcid")),
("E",("Glu","GlutamicAcid")),
("C",("Cys","Cysteine")),
("W",("Trp","Tryptophan")),
("R",("Arg","Arginine")),
("G",("Gly","Glycine"))
);

def getAminoAcidFromCode(aa : String, aaNameStyle : Int = 1, strict : Boolean = true) : String = {
if(aaNameStyle == 0) return aa;
AMINO_ACID_ABBRIV_MAP.get(aa) match {
case Some((short,full)) => {
if(aaNameStyle == 1) return short;
else return full;
}
case None => {
if(strict) error("Error: Unknown amino acid abbriv: "+aa);
if(aaNameStyle == 1) return "???";
else return "UnknownAminoAcid";
}
}
}

def getAminoAcidFromCodon(codon : String, aaNameStyle : Int = 1, strict : Boolean = true) : String = {
AMINO_ACID_CODON_MAP.get(codon) match {
case Some(aa) => {
getAminoAcidFromCode(aa,aaNameStyle,strict = strict);
}
case None => {
return getAminoAcidFromCode("?",aaNameStyle,strict = strict);
}
}
}

def getCodonIterator(iter : Iterator[Char]) : Iterator[String] = {
var buffer = "";
if(iter.hasNext) buffer = buffer + iter.next;
if(iter.hasNext) buffer = buffer + iter.next;
if(iter.hasNext) {
buffer = buffer + iter.next;
} else {
return Iterator[String]();
}

if(! iter.hasNext){
return Iterator[String](buffer);
}

return new Iterator[String]{
var buf = buffer;
var hn = true;
def hasNext : Boolean = hn;
def next : String = {
if(iter.hasNext) buffer = "" + iter.next;
if(iter.hasNext) buffer = buffer + iter.next;
if(iter.hasNext) buffer = buffer + iter.next;
if(buffer.size < 3) hn = false;
val out = buf;
buf = buffer;
out;
}
}
}

def getAminoAcidFromSeq(seq : Iterable[Char], aaNameStyle : Int = 1, strict : Boolean = true) : Iterator[String] = {
val iter = getCodonIterator(seq.iterator);
iter.map(c => getAminoAcidFromCodon(c,aaNameStyle,strict));
}



/******************************************************************************************************
* Holder and Helper Classes:
******************************************************************************************************/




/******************************************************************************************************
* FASTQ's:
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ object genomicAnnoUtils {
}
}*/


class EfficientGenomeSeqContainer(infiles : Seq[String]){
var initialReader = internalUtils.fileUtils.getLinesSmartUnzipFromSeq(infiles);

Expand All @@ -105,7 +106,7 @@ object genomicAnnoUtils {
// return (pos - bufferStart) / blockSize;
//}

def getSeqForInterval(chrom : String, start : Int, end : Int) : String = {
def getSeqForInterval(chrom : String, start : Int, end : Int, truncate : Boolean = false) : String = {
if(chrom != currChrom) {
error("ERROR: EfficientGenomeSeqContainer: requested sequence for chromosome other than current chromosome!");
}
Expand All @@ -125,13 +126,6 @@ object genomicAnnoUtils {
val firstBlockIdx = startPos / blockSize
val lastBlockIdx = (endPos-1) / blockSize

/*if(startPos % blockSize < 0 || endPos % blockSize < 0){
reportln("Encountered Negative pos?","note");
reportBufferStatus;
reportln(" start = "+start+", end = "+end+", firstBlockIdx = "+firstBlockIdx+", lastBlockIdx = "+lastBlockIdx,"note");
reportln(" startPos % blockSize = "+(startPos % blockSize)+", endPos % blockSize = "+(endPos % blockSize),"note");
}*/

val startOffset = startPos % blockSize;
val endOffset = ((endPos-1) % blockSize) + 1;

Expand All @@ -143,7 +137,6 @@ object genomicAnnoUtils {
return buffer(firstBlockIdx).substring(startOffset,blockSize) + buffer.slice(firstBlockIdx+1,lastBlockIdx).mkString("") + buffer(lastBlockIdx).substring(0,endOffset);
}
//buffer.substring(start - bufferStart,end - bufferStart);

}

var residualBuffer = "";
Expand Down Expand Up @@ -202,10 +195,10 @@ object genomicAnnoUtils {
error("FATAL ERROR: Cannot find chromosome \""+chrom+"\" in genome FASTA file!")
}
}


residualBuffer = "";
bufferStart = 0;
buffer = Vector[String]();


if(currChrom != chrom){
reportln("SKIPPING FASTA SEQUENCE FOR CHROMOSOME "+currChrom+" (probable cause: 0 reads found on chromosome, or bam/fasta mis-sorted)!","note");
Expand Down Expand Up @@ -240,11 +233,30 @@ object genomicAnnoUtils {
maxBuffer = math.max(maxBuffer,buffer.length);
}

def extendBufferToOrTruncate(end : Int) : Int = {
while(currIter.hasNext && bufferEnd < end){
buffer = buffer :+ getNextBlock();
}
bufferEnd;
}

def reportBufferStatus {
reportln(" [GenomeSeqContainer Status: "+"buf:("+currChrom+":"+bufferStart+"-"+bufferEnd+") "+"n="+buffer.length+", "+"MaxSoFar="+maxBuffer+"]","debug");
}

def fullStatusDump() : String = {
return "EfficientGenomeSeqContainer.fullStatusDump(): \n"+
"currChrom = " +currChrom + "\n"+
"bufferStart = " +bufferStart + "\n"+
"bufferEnd = "+bufferEnd+"\n"+
"buffer.size = "+buffer.size+"\n"+
"residualBuffer = " +residualBuffer + "\n"+
"buffer:\n"+
buffer.mkString("\n");
}
}


class EfficientGenomeSeqContainer_OLD(infiles : Seq[String]){
val initialReader = internalUtils.fileUtils.getLinesSmartUnzipFromSeq(infiles);

Expand Down
6 changes: 3 additions & 3 deletions src/HartleyUtils/src/main/scala/runner/runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import internalUtils.commandLineUI._;

object runner {

final val QORTS_VERSION = "1.2.19"; // REPLACE_THIS_QORTS_VERSION_VARIABLE_WITH_VERSION_NUMBER (note this exact text is used in a search-and-replace. Do not change it.)
final val QORTS_COMPILE_DATE = "Fri Feb 17 13:51:51 EST 2017"; // REPLACE_THIS_QORTS_DATE_VARIABLE_WITH_DATE (note this exact text is used in a search-and-replace. Do not change it.)
final val QORTS_COMPILE_TIME : Long = 1487357511; // REPLACE_THIS_QORTS_DATE_VARIABLE_WITH_TIME (note this exact text is used in a search-and-replace. Do not change it.)
final val QORTS_VERSION = "1.2.25"; // REPLACE_THIS_QORTS_VERSION_VARIABLE_WITH_VERSION_NUMBER (note this exact text is used in a search-and-replace. Do not change it.)
final val QORTS_COMPILE_DATE = "Sat Mar 4 13:22:59 EST 2017"; // REPLACE_THIS_QORTS_DATE_VARIABLE_WITH_DATE (note this exact text is used in a search-and-replace. Do not change it.)
final val QORTS_COMPILE_TIME : Long = 1488651779; // REPLACE_THIS_QORTS_DATE_VARIABLE_WITH_TIME (note this exact text is used in a search-and-replace. Do not change it.)

final val QORTS_MAJOR_VERSION = QORTS_VERSION.split("\\.")(0);
final val QORTS_MINOR_VERSION = QORTS_VERSION.split("\\.")(1);
Expand Down
4 changes: 2 additions & 2 deletions src/QoRTs/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: QoRTs
Version: 1.2.19
Date: 2017-02-17
Version: 1.2.25
Date: 2017-03-04
Title: Quality of RNA-seq Tool
Authors@R: c(person("Stephen Hartley, PhD", "Developer", role = c("aut", "cre"),
email = "[email protected]"))
Expand Down

0 comments on commit 648173c

Please sign in to comment.