Skip to content

Instantly share code, notes, and snippets.

@nh13
nh13 / RegenerateNmUqMdTags.scala
Last active November 5, 2017 05:38
A tool to regenerate the NM/UQ/MD tags on a SAM or BAM file
package com.nilshomer.bfx.examples.utilities
import com.fulcrumgenomics.FgBioDef.PathToFasta
import com.fulcrumgenomics.bam.Bams
import com.fulcrumgenomics.bam.api.{SamOrder, SamSource, SamWriter}
import com.fulcrumgenomics.cmdline.ClpGroups
import com.fulcrumgenomics.commons.CommonsDef.{PathToBam, SafelyClosable}
import com.fulcrumgenomics.sopt.{arg, clp}
import com.fulcrumgenomics.util.Io
import com.nilshomer.bfx.examples.cmdline.BfxExamplesTool
@nh13
nh13 / CountReadTypes.scala
Last active November 5, 2017 04:52
Tool to count the number of fragment and paired end reads
package com.nilshomer.bfx.examples.utilities
import com.fulcrumgenomics.bam.api.SamSource
import com.fulcrumgenomics.cmdline.ClpGroups
import com.fulcrumgenomics.sopt.{arg, clp}
import com.nilshomer.bfx.examples.cmdline.BfxExamplesTool
import com.fulcrumgenomics.commons.CommonsDef.{PathToBam, SafelyClosable}
import com.fulcrumgenomics.util.Io
@clp(
@nh13
nh13 / PrintName.scala
Created November 4, 2017 19:04
PrintName
package com.nilshomer.bfx.examples.utilities
import com.fulcrumgenomics.cmdline.ClpGroups
import com.fulcrumgenomics.sopt.{arg, clp}
import com.nilshomer.bfx.examples.cmdline.BfxExamplesTool
@clp(
description = "Prints your name to standard out and exits.",
group = ClpGroups.Utilities
)
@nh13
nh13 / HelloWorld.scala
Created November 4, 2017 18:51
Hello World
package com.nilshomer.bfx.examples.utilities
import com.fulcrumgenomics.cmdline.ClpGroups
import com.fulcrumgenomics.sopt.clp
import com.nilshomer.bfx.examples.cmdline.BfxExamplesTool
@clp(
description = "Prints hello world to standard out and exits.",
group = ClpGroups.Utilities
)
@nh13
nh13 / Makefile
Created September 6, 2017 18:12 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@nh13
nh13 / Test.MD
Created May 10, 2017 17:49
Link test

--input r1.fq r2.fq i1.fq --read-structures 5M5S65T 75T 8B

For more information on read structures see: https://github.com/fulcrumgenomics/fgbio/wiki/Read-Structures

The same number of input files and read structures must be provided, with one exception: if supplying exactly 1 or 2 fastq files, both of which are solely template reads, no read structures need be provided.

/** Performs the unit of work on a resource of type [A] cleaning up the resource in the case of an exception or upon
* completion.
* @param resource the resource upon which work is performed.
* @param cleanup the clean up method to apply to the resource when the work is complete.
* @param doWork the work to perform on the resource, returning a result of type [B].
* @tparam A the resource type
* @tparam B the result type of the work performed.
* @return Success if the work was performed successfully, Failure otherwise.
*/
@nh13
nh13 / README.md
Last active April 22, 2016 23:55
Htsjdk README
Unit Tests Integration Tests
Master GATK Picard
// jeanluc/src/main/scala/dagr/jeanluc/JeanLucMain.scala
/*
* The MIT License
*
* Copyright (c) 2016 Fulcrum Genomics LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@nh13
nh13 / AddDummyAlignmentInformation.java
Created November 16, 2015 06:11
AddDummyAlignmentInformation.java
package picard.sam;
import htsjdk.samtools.SAMFileHeader;
import htsjdk.samtools.SAMFileWriter;
import htsjdk.samtools.SAMFileWriterFactory;
import htsjdk.samtools.SAMRecord;
import htsjdk.samtools.SAMSequenceRecord;
import htsjdk.samtools.SamReader;
import htsjdk.samtools.SamReaderFactory;
import htsjdk.samtools.util.CloserUtil;