Skip to content

Instantly share code, notes, and snippets.

/bin/sh -c 'export JAILS="$(iocage list -h | cut -f 2)"; for jail in $JAILS; do iocage set vnet_default_interface=auto $jail; done; iocage set vnet_default_intercace=auto default'
Package Version
------------------------ -----------
alabaster 0.7.12
anndata 0.6.18
astropy 3.1.1
atomicwrites 1.3.0
attrs 18.2.0
Babel 2.6.0
backcall 0.1.0
certifi 2018.11.29
# http://gdac.broadinstitute.org/runs/sampleReports/latest/READ_Replicate_Samples.html
TCGAanalyze_RemoveReplicateSamples<-function(tabDF, typesample){
tabDF.typesample <- tabDF[, TCGAquery_SampleTypes(colnames(tabDF), typesample=typesample)]
# detect duplicated patient for typesample
tabDF.typesample.duplicated = duplicated(tabDF.typesample$patient)
if (sum(tabDF.typesample.duplicated)>0){
tabDF.typesample.not_duplicated = !(tabDF.typesample$patient %in% tabDF.typesample[,tabDF.typesample.duplicated]$patient)
# print(tabDF.typesample$patient[tabDF.typesample.duplicated])
# print(class(tabDF.typesample$patient[tabDF.typesample.duplicated]))
barcodes_solved_duplication=sapply(tabDF.typesample$patient[tabDF.typesample.duplicated],function(patient, dataset){
@rjpbonnal
rjpbonnal / rstudio.scm
Created October 17, 2016 08:25
guix and rstudio
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Vicente Vera Parra <vicentemvp@gmail.com>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;;
;;; This file is part of GNU Guix.
@rjpbonnal
rjpbonnal / gist:fdc94a2637a208d47a03
Created January 13, 2016 14:26
Scala Create an iterator using a Stream over 2 "aligned" files
test("Detect barcodes in forward and reverse reads in Fastq format") {
val readerR1 = new FastqReader(new java.io.File(getClass.getResource("/R1.fastq.gz").getPath))
val readerR2 = new FastqReader(new java.io.File(getClass.getResource("/R2.fastq.gz").getPath))
var list = List[String]()
case class Reads( r1: FastqRecord, r2: FastqRecord)
val stream: Stream[Reads]= {
def reads(readerR1: FastqReader, readerR2: FastqReader): Stream[Reads] = {
readerR1.hasNext() && readerR2.hasNext() match {
@rjpbonnal
rjpbonnal / trinity-pipeline-template.pbs
Last active August 29, 2015 14:26
The file is an example of the command lines used to run Trinity and PASA, at the time of the original work (“LincRNAs landscape in human lymphocytes highlights modulation of T cell differentiation by linc-MAF-4” by Ranzani V. et al.) Recently Trinity and PASA were updated, the current command lines and options can differ.
#!/bin/bash
# Copyright (C) 2015 INGM
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
@rjpbonnal
rjpbonnal / gist:2924846
Created June 13, 2012 15:40
Quick and dirty deployment of your Ruby Gem to your server(s)
# You must be the owner of the destination directory
rsync -avz --exclude-from=.gitignore --exclude '.git' -e ssh ./ bioinfoadm@starscream.ingm.ad:/usr/local/lib/ruby/gems/1.9.1/gems/yourgem
@rjpbonnal
rjpbonnal / MultiMemberGZIPInputStream.java
Created June 11, 2012 19:07
MultiMemberGZIPInputStream Concatenate multiple gzip in java
// reference http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4691425
// author: I'm not, I could not find he/she but the rights belong to it.
package x.y.z;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.io.IOException;
public
@rjpbonnal
rjpbonnal / gist:2658172
Created May 11, 2012 07:36
Parsing Cufflinks Gtf file/data, in an ActiveRecord style
g=Bio::Ngs::Cufflinks::Gtf.new "./spec/fixture/transcripts.gtf"
g.set_lazy
a=g.multi_exon.coverage_gt(3).length_gt(200)
#not yet parsed until you iterate of the transcripts
a.multi_exons.each_transcript {|t| puts t; break}
#accessing to an exon using the indexin:
g.read_transcript(10) #return a string of the block
g.get_tranascript(10) #return an object transcript.
@rjpbonnal
rjpbonnal / gist:1315778
Created October 26, 2011 08:26
CuffDiff output iterator, preliminar example
#CLASS DEFINITION Bio::Ngs::Cufflinks
class Diff
include Bio::Command::Wrapper
include Bio::Ngs::Cufflinks::Diff::Utils
set_program Bio::Ngs::Utils.binary("cuffdiff")
add_option "output-dir", :type => :string, :aliases => '-o', :default => "./"
add_option "time-series", :type => :boolean, :aliases => '-T'
add_option "min-alignment-count", :type => :numeric, :aliases => '-c'