github.com/vertgenlab/gonomics@v1.0.0/genomeGraph/singleReads.go (about)

     1  package genomeGraph
     2  
     3  /*
     4  import (
     5  	"github.com/vertgenlab/gonomics/fastq"
     6  	"github.com/vertgenlab/gonomics/sam"
     7  	"log"
     8  	"sync"
     9  	"time"
    10  )
    11  
    12  func GswSingleReadWrap(ref *SimpleGraph, readOne string, output string, threads int, seedLen int, stepSize int, scoreMatrix [][]int64, header *sam.SamHeader) {
    13  	log.SetFlags(log.Ldate | log.Ltime)
    14  	log.Printf("Paired end reads detected...\n")
    15  	log.Printf("Indexing the genome...\n\n")
    16  	seedHash := indexGenomeIntoMap(ref.Nodes, seedLen, stepSize)
    17  	var wgAlign, wgWrite sync.WaitGroup
    18  	//log.Printf("Setting up read and write channels...\n")
    19  	fastqPipe := make(chan *fastq.FastqBig, 824)
    20  	samPipe := make(chan *sam.SamAln, 824)
    21  	go fastq.ReadBigToChan(readOne, fastqPipe)
    22  	log.Printf("Scoring matrix used:\n%s\n", viewMatrix(scoreMatrix))
    23  	log.Printf("Aligning with the following settings:\n\t\tthreads=%d, seedLen=%d, stepSize=%d\n\n", threads, seedLen, stepSize)
    24  	wgAlign.Add(threads)
    25  	log.Printf("Aligning sequence to genome graph...")
    26  	start := time.Now()
    27  	for i := 0; i < threads; i++ {
    28  		go gswWorkerMemPool(ref, seedHash, seedLen, stepSize, scoreMatrix, fastqPipe, samPipe, &wgAlign)
    29  	}
    30  	wgWrite.Add(1)
    31  	go sam.SamChanToFile(samPipe, output, header, &wgWrite)
    32  	wgAlign.Wait()
    33  	stop := time.Now()
    34  	close(samPipe)
    35  	wgWrite.Wait()
    36  	log.Printf("GSW aligner finished in %.1f seconds\n", stop.Sub(start).Seconds())
    37  	log.Printf("Enjoy analyzing your data!\n\n--xoxo GG\n")
    38  }*/