Wednesday, 27 June 2018
Tuesday, 26 June 2018
Join Variable Numbers of Paths in Groovy
Cited from Joining Paths in Java
In Groovy, to print a variable number of arguments, the code is below.
import java.nio.file.*
String joinPath(String first, String... args){
Path path = Paths.get(first, args)
path.toString()
}
println joinPath('a')
println joinPath('a', 'b', 'c')
println joinPath('~/Data')
Converts a path string, or a sequence of strings that when joined form a path string, to aPath....APathrepresenting an empty path is returned if first is the empty string and more does not contain any non-empty strings.
In Groovy, to print a variable number of arguments, the code is below.
import java.nio.file.*
String joinPath(String first, String... args){
Path path = Paths.get(first, args)
path.toString()
}
println joinPath('a')
println joinPath('a', 'b', 'c')
println joinPath('~/Data')
java.nio.file.Path Class in Groovy
Cited from Groovy Goodness: Extra Methods for NIO Path
Groovy adds a lot of extra methods to the File object to work with the contents or find and filter files in a directory. These methods are now also added to the java.nio.file.Path class since Groovy 2.3.
import java.nio.file.*
Groovy adds a lot of extra methods to the File object to work with the contents or find and filter files in a directory. These methods are now also added to the java.nio.file.Path class since Groovy 2.3.
In a groovy script, the java.nio.file.Path class can be imported as the following.
Saturday, 23 June 2018
Thursday, 21 June 2018
Extract Sequences from Fasta
Cited from Toolkit for processing sequences in FASTA/Q formats
Extract sequences with names in file
name.lst, one sequence name per line: seqtk subseq in.fq name.lst > out.fq
Wednesday, 20 June 2018
What is a Read Group?
Cited from Read Groups
There is no formal definition of what is a read group, but in practice, this term refers to a set of reads that were generated from a single run of a sequencing instrument.
In the simple case where a single library preparation derived from a single biological sample was run on a single lane of a flowcell, all the reads from that lane run belong to the same read group. When multiplexing is involved, then each subset of reads originating from a separate library run on that lane will constitute a separate read group.
There is no formal definition of what is a read group, but in practice, this term refers to a set of reads that were generated from a single run of a sequencing instrument.
In the simple case where a single library preparation derived from a single biological sample was run on a single lane of a flowcell, all the reads from that lane run belong to the same read group. When multiplexing is involved, then each subset of reads originating from a separate library run on that lane will constitute a separate read group.
Subscribe to:
Posts (Atom)