Skip to content

Instantly share code, notes, and snippets.

View fataltes's full-sized avatar
🤷‍♀️

Fatemeh Almodaresi fataltes

🤷‍♀️
  • University of Maryland at College Park
  • US
View GitHub Profile
@fataltes
fataltes / GCModel
Created October 10, 2017 20:40
A helper class to read the binary files related to bias model and exact model for project 4.
import pandas as pd
import numpy as np
class GCModel:
def __init__(self):
self.obs_weights_ = None
self.exp_weights_ = None
self.obs_ = None
self.exp_ = None
self.dims_ = None
@fataltes
fataltes / pufferize.py
Last active December 21, 2017 17:48
BCalm Pufferizer
#!/usr/bin/env python
import sys, os
if len(sys.argv) < 4:
print("alters BCALM's unitigs so that they fit pufferfish input. more specifically:")
print(" the script considers the set B and E of all k-mers that are extremities of the reference genomes, respectively beginning and end of genomes.")
print(" output is: modified unitigs such that each k-mer in B should be the beginning of an unitig, and each kmer in E should be end of an unitig.")
print(" in order words, unitigs are split at kmers that are extremities of the reference sequences")
exit("arguments: references.fa unitigs.fa k")
references=sys.argv[1]
int main(int argc, char *argv[]) {
uint16_t num_samples = 2586;
std::string filename = argv[1];
BitVectorRRR eqcls(filename);
size_t totalEqClsCnt = eqcls.bit_size()/num_samples; //222584822;
std::cout << "Total bit size: " << eqcls.bit_size() << "\ntotal # of equivalence classes: " << totalEqClsCnt << "\n";
size_t gigs = 8;
std::string dir = "bvs_8g";
int getPufferfishContigStats(IndexT& pi) {
//size_t k = pi.k();
CanonicalKmer::k(pi.k());
size_t found = 0;
size_t notFound = 0;
size_t correctPosCntr = 0;
size_t incorrectPosCntr = 0;
size_t numTrueTxp = 0;
size_t numLostTxp = 0;
std::ofstream out("contigInfo.txt");