static void doAlignments(struct sqlConnection *conn, char *db)
{
int taxon = findTaxon(conn,db);

populateMissingVgPrbAli(conn, taxon, db, "vgPrbAli");

updateVgPrbAli(conn, db, "vgPrbAli","vgProbes");

doAccessionsAli(conn, taxon, db);

doFakeBacAli(conn, taxon, db);

assembleAllPsl(conn, taxon, db);

rollupPsl("vgPrbNonBlat.psl", "vgProbes", conn, db);

updateVgPrbAli(conn, db, "vgPrbAli","vgProbes");

doBlat(conn, taxon, db);   

rollupPsl("blatNearBest.psl", "vgProbes", conn, db);

updateVgPrbAli(conn, db, "vgPrbAli","vgProbes");

markNoneVgPrbAli(conn, taxon, db, "vgPrbAli");

}
static void doAlignmentsPslMap(struct sqlConnection *conn, char *db, char *fromDb)
{
int taxon = findTaxon(conn,db);
int fromTaxon = findTaxon(conn,fromDb);

populateMissingVgPrbAli(conn, fromTaxon, db, "vgPrbAliAll");

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

doPslMapAli(conn, taxon, db, fromTaxon, fromDb);

rollupPsl("vgPrbPslMap.psl", "vgAllProbes", conn, db);

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

markNoneVgPrbAli(conn, fromTaxon, db, "vgPrbAliAll");

}
static void doAlignmentsReMap(
    struct sqlConnection *conn, 
    char *db, char *fromDb, char *track, char *fasta)
/* re-map anything in track specified that is not aligned, 
      nor even attempted yet, using specified fasta file. */
{
int taxon = findTaxon(conn,db);
int fromTaxon = findTaxon(conn,fromDb);

populateMissingVgPrbAli(conn, fromTaxon, db, "vgPrbAliAll");

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

doReMapAli(conn, taxon, db, fromTaxon, fromDb, track, fasta);

rollupPsl("vgPrbReMap.psl", "vgAllProbes", conn, db);

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

markNoneVgPrbAli(conn, fromTaxon, db, "vgPrbAliAll");

}
static void makeFakeProbeSeq(struct sqlConnection *conn, char *db)
/* get probe seq from primers, bacEndPairs, refSeq, genbank, gene-name */
{

int taxon = findTaxon(conn,db);

//restore: 
doPrimers(conn, taxon, db);

//restore: 
doBacEndPairs(conn, taxon, db);

//restore: 
doAccessionsSeq(conn, taxon, db);

}
static void doAlignmentsSelfMap(
    struct sqlConnection *conn, char *db)
/* copy anything in vgProbes but not in vgAllProbes to vgAllProbes */
{
int taxon = findTaxon(conn,db);

populateMissingVgPrbAli(conn, taxon, db, "vgPrbAliAll");

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

doSelfMapAli(conn, taxon, db);

rollupPsl("vgPrbSelfMap.psl", "vgAllProbes", conn, db);

updateVgPrbAli(conn, db, "vgPrbAliAll","vgAllProbes");

markNoneVgPrbAli(conn, taxon, db, "vgPrbAliAll");

}
Example #6
0
void PhyloSummary::print(int i, ofstream& out, string output){
	try {
		map<string,int>::iterator it;
		for(it=tree[i].children.begin();it!=tree[i].children.end();it++){
			
			if (tree[it->second].total != 0)  {
                
				int totalChildrenInTree = 0;
                
				map<string,int>::iterator it2;
				for(it2=tree[it->second].children.begin();it2!=tree[it->second].children.end();it2++){
					if (tree[it2->second].total != 0)  {   totalChildrenInTree++; }
				}
                
                if ((output == "detail") && (printlevel >= tree[it->second].level)) {
                    if (relabund) {
                        out << tree[it->second].level << "\t" << tree[it->second].rank << "\t" << tree[it->second].name << "\t" << totalChildrenInTree << "\t" << (tree[it->second].total/(double) tree[0].total);
                    }else {
                        out << tree[it->second].level << "\t" << tree[it->second].rank << "\t" << tree[it->second].name << "\t" << totalChildrenInTree << "\t" << tree[it->second].total;
                    }
                }else {
                    if (printlevel == tree[it->second].level) { //leaf node - we want to print it. Use rank to find full taxonomy
                        if (relabund) {
                            out << findTaxon(tree[it->second].rank) << '\t' << tree[it->second].total/(double) tree[0].total;
                        }else {
                            out << findTaxon(tree[it->second].rank) << '\t' << tree[it->second].total;
                        }
                    }
                }
                
                if (relabund) {
                    map<string, int>::iterator itGroup;
                    if (groupmap != NULL) {
                        vector<string> mGroups = groupmap->getNamesOfGroups();
                        for (int i = 0; i < mGroups.size(); i++) {
                            if (((output == "detail") && (printlevel >= tree[it->second].level)) || (printlevel == tree[it->second].level)) {
                                out  << '\t' << (tree[it->second].groupCount[mGroups[i]]/(double)groupmap->getNumSeqs(mGroups[i]));
                            }
                        }
                    }else if (ct != NULL) {
                        if (ct->hasGroupInfo()) {
                            vector<string> mGroups = ct->getNamesOfGroups();
                            for (int i = 0; i < mGroups.size(); i++) {
                                if (((output == "detail") && (printlevel >= tree[it->second].level)) || (printlevel == tree[it->second].level)) {
                                    out  << '\t' << (tree[it->second].groupCount[mGroups[i]]/(double)ct->getGroupCount(mGroups[i]));
                                }
                            }
                        }
                    }
                }else {
                    map<string, int>::iterator itGroup;
                    if (groupmap != NULL) {
                        vector<string> mGroups = groupmap->getNamesOfGroups();
                        for (int i = 0; i < mGroups.size(); i++) {
                            if (((output == "detail") && (printlevel >= tree[it->second].level)) || (printlevel == tree[it->second].level)) {
                                out  << '\t' << tree[it->second].groupCount[mGroups[i]];
                            }
                        }
                    }else if (ct != NULL) {
                        if (ct->hasGroupInfo()) {
                            vector<string> mGroups = ct->getNamesOfGroups();
                            for (int i = 0; i < mGroups.size(); i++) {
                                if (((output == "detail") && (printlevel >= tree[it->second].level)) || (printlevel == tree[it->second].level)) {
                                    out  << '\t' << tree[it->second].groupCount[mGroups[i]];
                                }
                            }
                        }
                    }
                    
                }
                if (((output == "detail") && (printlevel >= tree[it->second].level)) || (printlevel == tree[it->second].level)) { out << endl; }
			}
			
			print(it->second, out, output);
		}
	}
	catch(exception& e) {
		m->errorOut(e, "PhyloSummary", "print");
		exit(1);
	}
}