Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A kscript/kotlin tool to filter fasta files by length
//DEPS de.mpicbg.scicomp:kutils:0.4
import de.mpicbg.scicomp.bioinfo.openFasta
import kotlin.system.exitProcess
if (args.size != 2) {
System.err.println("Usage: fasta_filter <fasta> <length_cutoff>")
val fastaFile = File(args[0])
val lengthCutoff = args[1].toInt()
filter { it.sequence.length >= lengthCutoff }.
forEach { print(it.toEntryString()) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment