❯ parallel -j4 convert -density 400 +antialias {} {.}.raster.pdf ::: **/*.pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Creates a fixed size thread pool executor that will rethrow exceptions from submitted jobs. */ | |
class ThreadPoolExecutorWithExceptions(val threads: Int) | |
extends ThreadPoolExecutor(threads, threads, 0, TimeUnit.SECONDS, new LinkedBlockingDeque[Runnable]) { | |
/** A place to hold an exception that may have been raised by any of the executed futures. */ | |
protected var exception: Option[Throwable] = None | |
override protected def afterExecute(runnable: Runnable, throwable: Throwable): Unit = { | |
if (throwable == null && runnable.isInstanceOf[Future[_]]) try { | |
val future = runnable.asInstanceOf[Future[_]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.cvbio.sam | |
import com.fulcrumgenomics.FgBioDef.View | |
import com.fulcrumgenomics.bam._ | |
import com.fulcrumgenomics.bam.api.{SamRecord, SamSource} | |
import htsjdk.samtools.SAMRecord | |
import htsjdk.samtools.filter.{DuplicateReadFilter, FailsVendorReadQualityFilter, SamRecordFilter, SecondaryAlignmentFilter} | |
import htsjdk.samtools.util.AbstractRecordAndOffset.AlignmentType.{Deletion, Insertion, Match} | |
import htsjdk.samtools.util.SamLocusIterator.LocusInfo | |
import htsjdk.samtools.util.{Interval, SamLocusIterator => HtsJdkSamLocusIterator} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1.3 | |
FROM openjdk:8-slim-buster AS builder | |
RUN apt-get update && apt-get install -y git | |
# Not actually needed by any subsequent commands, but shows how you can bake | |
# things into the builder layer if they are commonly needed by other layers. | |
RUN mkdir -p -m 0600 ~/.ssh \ | |
&& ssh-keyscan github.com >> ~/.ssh/known_hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.cvbio.coord | |
import com.fulcrumgenomics.fasta.SequenceDictionary | |
import htsjdk.samtools.util.{Interval => HtsJdkInterval, Locatable => HtsJdkLocatable} | |
/** Any interface that can be stranded. */ | |
trait Stranded { def positiveStrand: Boolean } | |
/** An intermediate mixin that will provide access to HTSJDK's interval API. */ | |
private[coord] trait IntervalIntermediate extends HtsJdkInterval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fulcrumgenomics.bam.api.SamSource | |
import com.fulcrumgenomics.commons.CommonsDef._ | |
/** Namespace for SAM/BAM source utilities. */ | |
object SamSourceUtil { | |
/** Return the only sample in this SAM/BAM source otherwise raise an exception. */ | |
def onlySample(source: SamSource): String = { | |
validateHasSingleSample(source) | |
source.header.getReadGroups.map(_.getSample).toSeq.head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.cvbio.collection | |
import io.cvbio.io.Io | |
import com.fulcrumgenomics.commons.collection.SelfClosingIterator | |
import java.util.concurrent.atomic.AtomicReference | |
import java.util.concurrent._ | |
import scala.concurrent.duration.{Duration, DurationInt} | |
import scala.concurrent.{Await, ExecutionContext, Future} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The MIT License | |
* | |
* Copyright © 2022 Clint Valentine | |
* | |
* 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 | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TOKEN=??? | |
curl -s -X GET \ | |
-H "Content-Type: application/octet-stream" \ | |
-H "Authorization: Bearer ${TOKEN}" "https://my.qiagendigitalinsights.com/bbp/data/files/cosmic" \ | |
-o files.txt | |
parallel -k \ | |
'curl -X GET \ | |
-H "Content-Type: application/octet-stream" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.twinstrandbio.collection | |
import scala.collection.compat._ | |
import scala.collection.{StrictOptimizedIterableOps, mutable} | |
/** A mutable bi-directional map. There is a 1:1 mapping between keys and values. */ | |
class BiMap[K, V]() extends mutable.Map[K, V] | |
with mutable.MapOps[K, V, mutable.Map, BiMap[K, V]] | |
with StrictOptimizedIterableOps[(K, V), mutable.Iterable, BiMap[K, V]] { | |
private val forward = mutable.HashMap.empty[K, V] |