Skip to content

Instantly share code, notes, and snippets.

@mariokostelac
mariokostelac / writeFile.js
Created February 10, 2016 10:17
Lambda with FS operations
var fs = require('fs');
var filename = "/tmp/test";
exports.handler = function(event, context) {
fs.writeFile(filename, JSON.stringify(context), function(err) {
if(err) {
return console.log(err);
}
fs.readFile(filename, function(err, data) {
1| 433 (2.56%) -----------------------------------------------------
2| 132 (0.78%) ----------------
3| 149 (0.88%) -------------------
4| 134 (0.79%) -----------------
5| 128 (0.76%) ----------------
6| 140 (0.83%) -----------------
7| 124 (0.73%) ---------------
8| 121 (0.72%) ---------------
10| 149 (0.88%) -------------------
11| 139 (0.82%) -----------------
1|1057 (6.26%) ----------------------------------------------------------------------------------------------------------------------------------------
2| 147 (0.87%) -------------------
3| 138 (0.82%) ------------------
4| 124 (0.73%) ----------------
5| 138 (0.82%) ------------------
6| 100 (0.59%) -------------
7| 115 (0.68%) ---------------
8| 122 (0.72%) ----------------
9| 155 (0.92%) --------------------
10| 170 (1.01%) ----------------------
 1|1057 (6.26%) ----------------------------------------------------------------------------------------------------------------------------------------
 2| 147 (0.87%) -------------------
 3| 138 (0.82%) ------------------
 4| 124 (0.73%) ----------------
 5| 138 (0.82%) ------------------
 6| 100 (0.59%) -------------
 7| 115 (0.68%) ---------------
 8| 122 (0.72%) ----------------
 9| 155 (0.92%) --------------------
10| 170 (1.01%) ----------------------
/Users/mario/bioinf/nmeth/../reference/escherichia_coli_NCBI.fa /Users/mario/bioinf/nmeth/contigs_fast.fasta
NUCMER
[REF] [QRY]
[Sequences]
TotalSeqs 1 1
AlignedSeqs 1(100.00%) 1(100.00%)
UnalignedSeqs 0(0.00%) 0(0.00%)
[Bases]
mkdir -p obj_test/src/alignment/
g++-4.8 -static-libgcc -static-libstdc++ -D__cplusplus=201103L -I"./src/" -I"/usr/include/" -I"libs/libdivsufsort-2.0.1/build/include" -I"libs/seqan-library-1.4.2/include" -O3 -fdata-sections -ffunction-sections -c -fmessage-length=0 -ffreestanding -fopenmp -m64 -std=c++11 -Werror=return-type -Wuninitialized -pthread -march=native -o obj_test/src/alignment/opal.o src/alignment/opal.cpp
/var/folders/1v/mxp10j955jzc7s812dt7l9f80000gn/T//cc6Iljv3.s:156:no such instruction: `vpxor %xmm12, %xmm12,%xmm12'
/var/folders/1v/mxp10j955jzc7s812dt7l9f80000gn/T//cc6Iljv3.s:158:no such instruction: `vmovd %eax, %xmm0'
/var/folders/1v/mxp10j955jzc7s812dt7l9f80000gn/T//cc6Iljv3.s:162:no such instruction: `vpshufb %xmm12, %xmm0,%xmm12'
/var/folders/1v/mxp10j955jzc7s812dt7l9f80000gn/T//cc6Iljv3.s:206:no such instruction: `vpxor %xmm0, %xmm0,%xmm0'
/var/folders/1v/mxp10j955jzc7s812dt7l9f80000gn/T//cc6Iljv3.s:212:no such instruction: `vmovd %r14d, %xmm1'
/var/folders/1v/mxp10j955jzc7s812dt7l9f8000
/data/reference/escherichia_coli_NCBI.fa /data/simulated_datasets/ecolli_15x/escherichia_coli_NCBI-e0.00/layout_20151026_115352/dnadiff_results/../contigs_fast.fasta
NUCMER
[REF] [QRY]
[Sequences]
TotalSeqs 1 1
AlignedSeqs 1(100.00%) 1(100.00%)
UnalignedSeqs 0(0.00%) 0(0.00%)
[Bases]
20| 10 (0.15%) ---
21| 21 (0.31%) ------
22| 45 (0.66%) ------------
23| 76 (1.12%) --------------------
24|130 (1.92%) -----------------------------------
25|200 (2.95%) -----------------------------------------------------
26|258 (3.81%) --------------------------------------------------------------------
27|308 (4.54%) ---------------------------------------------------------------------------------
28|360 (5.31%) -----------------------------------------------------------------------------------------------
29|444 (6.55%) ---------------------------------------------------------------------------------------------------------------------
20| 10 (0.15%) ---
21| 21 (0.31%) ------
22| 45 (0.66%) ------------
23| 76 (1.12%) --------------------
24|130 (1.92%) -----------------------------------
25|200 (2.95%) -----------------------------------------------------
26|258 (3.81%) --------------------------------------------------------------------
27|308 (4.54%) ---------------------------------------------------------------------------------
28|360 (5.31%) -----------------------------------------------------------------------------------------------
29|444 (6.55%) ---------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env bash
awk '
{printf "%d\t", $1 + 1} #Aiid
{printf "%d\t", $2 + 1} #Biid
{if ($5 == $9) { # orient
printf "f\t"
} else {
printf "r\t"
}}