Exemplo n.º 1
0
int lassort(libmaus2::util::ArgParser const & arg, libmaus2::util::ArgInfo const &)
{
	std::string const outfilename = arg[0];
	std::vector<std::string> VI;
	for ( uint64_t i = 1 ; i < arg.size(); ++i )
		VI.push_back(arg[i]);
	int64_t const tspace = libmaus2::dazzler::align::AlignmentFile::getTSpace(VI);

	libmaus2::dazzler::align::AlignmentWriter::unique_ptr_type AW(
		new libmaus2::dazzler::align::AlignmentWriter(outfilename,tspace,false /* index */, 0 /* expt */)
	);

	libmaus2::dazzler::align::Overlap OVL;
	for ( uint64_t i = 0; i < VI.size(); ++i )
	{
		libmaus2::dazzler::align::AlignmentFileRegion::unique_ptr_type PIN(libmaus2::dazzler::align::OverlapIndexer::openAlignmentFileWithoutIndex(VI[i]));

		std::vector < libmaus2::dazzler::align::Overlap > VOVL;
		while ( PIN->getNextOverlap(OVL) )
		{
			if ( VOVL.size() && VOVL[0].aread != OVL.aread )
				handleVector(VOVL,*AW);
			VOVL.push_back(OVL);
		}
		handleVector(VOVL,*AW);
	}

	AW.reset();

	return EXIT_SUCCESS;
}
Exemplo n.º 2
0
SBezier SBezier::From(Vector4 p0, Vector4 p1, Vector4 p2, Vector4 p3) {
    SBezier ret;
//**walter steffe--begin
    Vector pp0=p0.PerspectiveProject();
    Vector pp1=p1.PerspectiveProject();
    Vector pp2=p2.PerspectiveProject();
    Vector pp3=p3.PerspectiveProject();
    TColgp_Array1OfPnt AP(0,3);
    TColStd_Array1OfReal AW(0,3);
    AW.SetValue(0,p0.w);
    AW.SetValue(1,p1.w);
    AW.SetValue(2,p2.w);
    AW.SetValue(3,p3.w);
    AP.SetValue(0,gp_Pnt(pp0.x,pp0.y,pp0.z));
    AP.SetValue(1,gp_Pnt(pp1.x,pp1.y,pp1.z));
    AP.SetValue(2,gp_Pnt(pp2.x,pp2.y,pp2.z));
    AP.SetValue(3,gp_Pnt(pp3.x,pp3.y,pp3.z));
    ret.hCurve=new Geom_BezierCurve(AP, AW);
//**walter steffe--end
    ZERO(&ret);
    ret.deg = 3;
    ret.weight[0] = p0.w;
    ret.ctrl  [0] = p0.PerspectiveProject();
    ret.weight[1] = p1.w;
    ret.ctrl  [1] = p1.PerspectiveProject();
    ret.weight[2] = p2.w;
    ret.ctrl  [2] = p2.PerspectiveProject();
    ret.weight[3] = p3.w;
    ret.ctrl  [3] = p3.PerspectiveProject();
    return ret;
}
Exemplo n.º 3
0
SBezier SBezier::From(Vector4 p0, Vector4 p1) {
    SBezier ret;
//**walter steffe--begin
    Vector pp0=p0.PerspectiveProject();
    Vector pp1=p1.PerspectiveProject();
    TColgp_Array1OfPnt AP(0,1);
    TColStd_Array1OfReal AW(0,1);
    AW.SetValue(0,p0.w);
    AW.SetValue(1,p1.w);
    AP.SetValue(0,gp_Pnt(pp0.x,pp0.y,pp0.z));
    AP.SetValue(1,gp_Pnt(pp1.x,pp1.y,pp1.z));
    gp_Pnt P0=AP.Value(0);
    gp_Pnt P1=AP.Value(1);
    double W0=AW.Value(0);
    double W1=AW.Value(1);
    Vector dpp=pp0.Minus(pp1);
    if(dpp.Magnitude() > 1.e-10)
      ret.hCurve=new Geom_BezierCurve(AP, AW);
//      ret.hCurve=new Geom_BezierCurve(AP);
//**walter steffe--end
    ZERO(&ret);
    ret.deg = 1;
    ret.weight[0] = p0.w;
    ret.ctrl  [0] = p0.PerspectiveProject();
    ret.weight[1] = p1.w;
    ret.ctrl  [1] = p1.PerspectiveProject();
    return ret;
}
Exemplo n.º 4
0
				static std::vector<std::string> splitFile(std::string const & aligns, std::string const & prefix, uint64_t const n, bool const tmp)
				{
					libmaus2::aio::InputStreamInstance algnfile(aligns);
					libmaus2::dazzler::align::AlignmentFile algn(algnfile);
					libmaus2::dazzler::align::Overlap OVL;

					AlignmentSplitWriter AW(algn.tspace,prefix,n,tmp);

					// get next overlap                                                                                                                                                                                                                                
					while ( algn.getNextOverlap(algnfile,OVL) )
						AW.push(OVL);
						
					return AW.outputfilenames;
				}
Exemplo n.º 5
0
int lasfilterquality(libmaus2::util::ArgParser const & arg, libmaus2::util::ArgInfo const & /* arginfo */)
{
	libmaus2::dazzler::align::AlignmentFileRegion::unique_ptr_type Pfile(libmaus2::dazzler::align::OverlapIndexer::openAlignmentFileWithoutIndex(arg[2]));
	int64_t const tspace = Pfile->Palgn->tspace;
	libmaus2::dazzler::align::Overlap OVL;
	libmaus2::dazzler::align::AlignmentWriter AW(arg[1],tspace,true);
	libmaus2::dazzler::db::DatabaseFile DB(arg[0]);
	DB.computeTrimVector();
	libmaus2::dazzler::db::Track::unique_ptr_type Pqual(DB.readTrack("qual"));
	libmaus2::dazzler::db::TrackAnnoInterface const & qualanno = Pqual->getAnno();
	libmaus2::autoarray::AutoArray<unsigned char> const & qualdata = *(Pqual->Adata);
	unsigned int const defq = 25;
	unsigned int const q = arg.argPresent("q") ? arg.getUnsignedNumericArg<uint64_t>("q") : defq;

	libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > I;
	libmaus2::autoarray::AutoArray < std::pair< int32_t,int32_t > > O;
	uint64_t Io = 0;
	int64_t prevaread = -1;

	while ( Pfile->getNextOverlap(OVL) )
	{
		int64_t const aread = OVL.aread;

		if ( aread != prevaread )
		{
			Io = 0;

			int64_t const alow = qualanno[aread];
			int64_t const ahigh = qualanno[aread+1];
			unsigned char const * ua = qualdata.begin() + alow;
			unsigned char const * ue = qualdata.begin() + ahigh;

			unsigned char const * up = ua;
			while ( up != ue )
			{
				while ( up != ue && *up > q )
					++up;
				assert ( up == ue || *up <= q );

				unsigned char const * ul = up;
				while ( up != ue && *up <= q )
					++up;

				if ( up != ul )
					I.push(Io,std::pair<uint64_t,uint64_t>((ul-ua)*tspace,(up-ua)*tspace));
			}

			#if 0
			std::cerr << aread << "\t";
			for ( uint64_t i = 0; i < Io; ++i )
				std::cerr << "(" << I[i].first << "," << I[i].second << ")";
			std::cerr << std::endl;
			#endif

			prevaread = aread;
		}

		OVL.alignToTracePoints(tspace);
		uint64_t const o = OVL.filterIntervals(I.begin(),I.begin()+Io,O);

		for ( uint64_t i = 0; i < o; ++i )
		{
			libmaus2::dazzler::align::Overlap fOVL = OVL.filter(O[i],tspace);
			assert ( ! fOVL.isEmpty() );
			AW.put(fOVL);
		}
	}

	return EXIT_SUCCESS;
}