Commit 59fb76fb authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

posible to get list from dict now

parent 231f2f60
......@@ -14,12 +14,12 @@
*/
package nl.lumc.sasc.biopet.utils.intervals
import java.io.{ PrintWriter, File }
import java.io.{ File, PrintWriter }
import htsjdk.samtools.SAMSequenceDictionary
import htsjdk.samtools.reference.FastaSequenceFile
import scala.collection.JavaConversions._
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.io.Source
......@@ -154,8 +154,13 @@ object BedRecordList {
def fromReference(file: File) = {
val referenceFile = new FastaSequenceFile(file, true)
val dict = referenceFile.getSequenceDictionary
referenceFile.close()
fromDict(dict)
}
fromList(for (contig <- referenceFile.getSequenceDictionary.getSequences) yield {
def fromDict(dict: SAMSequenceDictionary) = {
fromList(for (contig <- dict.getSequences) yield {
BedRecord(contig.getSequenceName, 0, contig.getSequenceLength)
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment