colCount,
67 unsigned intuFlags ) :
95 if(!track.
Assign(annot)) {
111 "BedGraph writer does not support this annotation type.");
128 intnumRows =
table.GetNum_rows();
129 for(
int row=0;
row< numRows; ++
row) {
134 "Processing terminated by user");
139 constvector<CRef<CSeqTable_column> >
columns=
table.GetColumns();
140 for(
size_tcol = 0; col <
columns.size(); ++col) {
144 if(fieldName ==
"Seq-table location") {
160 if(chromId.empty()) {
161chromId =
"unknown";
167 constvector<CRef<CSeqTable_column> >
columns=
table.GetColumns();
168 for(
size_tcol = 0; col <
columns.size(); ++col) {
173 if(
columns[col]->TryGetInt(
row, chromStart)) {
184 constvector<CRef<CSeqTable_column> >
columns=
table.GetColumns();
185 for(
size_tcol = 0; col <
columns.size(); ++col) {
189 if(fieldName ==
"span") {
190 if(
columns[col]->TryGetInt(
row, chromEnd)) {
191chromEnd += chromStart;
199 if(
columns[col]->TryGetInt(
row, chromEnd)) {
208 doublechromValue(0);
210 constvector<CRef<CSeqTable_column> >
columns=
table.GetColumns();
211 for(
size_tcol = 0; col <
columns.size(); ++col) {
215 if(fieldName ==
"values") {
216 if(
columns[col]->TryGetReal(
row, chromValue)) {
220 if(
columns[col]->TryGetInt(
row, intValue)) {
221chromValue = intValue;
243 constlist<CRef<CSeq_graph> >& graphs = annot.
GetData().
GetGraph();
251cerr << except.
GetMsg() << endl;
269cit != features.end();
275cerr << except.
GetMsg() << endl;
310 "Processing terminated by user");
320 "BedGraph writer does not support feature locations that are not intervals.");
324 const string& scoreStr = feature.
GetNamedQual(
"score");
325 if(scoreStr.empty()) {
329 "BedGraph writer only supports features with a \"score\" qualifier.");
339 "BedGraph writer encountered feature with bad \"score\" qualifier.");
362 location.GetId()->GetLabel(&chromId);
363 size_tchromStep = graph.
GetComp();
364 doublescale = graph.
GetA();
370 for(
size_tvalIndex = 0; valIndex < numValues; ++valIndex) {
375 "Processing terminated by user");
380 size_trecordStart = valIndex * chromStep;
383 size_trecordEnd = recordStart + chromStep - 1;
401 location.GetId()->GetLabel(&chromId);
402 size_tchromStep = graph.
GetComp();
403 doublescale = graph.
GetA();
409 for(
size_tvalIndex = 0; valIndex < numValues; ++valIndex) {
414 "Processing terminated by user");
419 size_trecordStart = valIndex * chromStep;
422 size_trecordEnd = recordStart + chromStep;
425 double value=
offset+ scale*(
unsignedchar)values[valIndex];
441 location.GetId()->GetLabel(&chromId);
442 size_tchromStep = graph.
GetComp();
443 doublescale = graph.
GetA();
449 for(
size_tvalIndex = 0; valIndex < numValues; ++valIndex) {
454 "Processing terminated by user");
459 size_trecordStart = valIndex * chromStep;
462 size_trecordEnd = recordStart + chromStep - 1;
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Encapsulation of the BED feature record.
void SetChromId(const string &)
void SetChromStart(size_t)
bool Write(CNcbiOstream &)
void SetChromValue(double)
bool xWriteAnnotFeatureTable(const CBedTrackRecord &, const CSeq_annot &)
bool xWriteSingleGraphReal(const CBedTrackRecord &, const CSeq_graph &)
virtual ~CBedGraphWriter()
bool xWriteSingleGraph(const CBedTrackRecord &, const CSeq_graph &)
bool xWriteAnnotGraphs(const CBedTrackRecord &, const CSeq_annot &)
bool xWriteSingleFeature(const CBedTrackRecord &, const CSeq_feat &)
bool xWriteSingleGraphByte(const CBedTrackRecord &, const CSeq_graph &)
bool xWriteSingleGraphInt(const CBedTrackRecord &, const CSeq_graph &)
bool WriteAnnot(const CSeq_annot &, const string &="", const string &="")
Write a raw Seq-annot to the internal output stream.
CBedGraphWriter(CScope &scope, CNcbiOstream &ostr, unsigned int colCount=12, unsigned int flags=fNormal)
Constructor.
bool xWriteAnnotSeqTable(const CBedTrackRecord &, const CSeq_annot &)
Encapsulation of a track line in the BED file format.
bool Assign(const CSeq_annot &)
bool Write(CNcbiOstream &)
bool IsSeq_table(void) const
bool IsFtable(void) const
namespace ncbi::objects::
const string & GetNamedQual(const CTempString &qual_name) const
Return a named qualifier.
Defines and provides stubs for a general interface to a variety of file formatters.
static const char location[]
static const column_t columns[]
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
@ eContent
Untagged human-readable accession or the like.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
TField_id GetField_id(void) const
Get the Field_id member data.
bool IsSetField_name(void) const
any column can be identified by ASN.1 text locator string with omitted object type.
bool IsSetField_id(void) const
Check if a value has been assigned to Field_id data member.
const TField_name & GetField_name(void) const
Get the Field_name member data.
@ eField_id_location_id
location Seq-id
@ eField_id_location_to
interval to
@ eField_id_location_from
interval from
const TLocation & GetLocation(void) const
Get the Location member data.
const TId & GetId(void) const
Get the Id member data.
TFrom GetFrom(void) const
Get the From member data.
TTo GetTo(void) const
Get the To member data.
const TInt & GetInt(void) const
Get the variant data.
const TGraph & GetGraph(void) const
Get the Graph member data.
bool IsInt(void) const
Check if variant Int is selected.
const TValues & GetValues(void) const
Get the Values member data.
TB GetB(void) const
Get the B member data.
const TByte & GetByte(void) const
Get the variant data.
const TReal & GetReal(void) const
Get the variant data.
bool IsReal(void) const
Check if variant Real is selected.
const TValues & GetValues(void) const
Get the Values member data.
bool IsByte(void) const
Check if variant Byte is selected.
const TValues & GetValues(void) const
Get the Values member data.
const TLoc & GetLoc(void) const
Get the Loc member data.
TNumval GetNumval(void) const
Get the Numval member data.
TA GetA(void) const
Get the A member data.
TComp GetComp(void) const
Get the Comp member data.
const TGraph & GetGraph(void) const
Get the variant data.
const TSeq_table & GetSeq_table(void) const
Get the variant data.
const TFtable & GetFtable(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const GenericPointer< typename T::ValueType > T2 value
#define row(bind, expected)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4