A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/bam__load__option__panel_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/loaders/bam_load_option_panel.cpp Source File

46 #include <wx/filename.h> 48 #include <wx/stattext.h> 49 #include <wx/statbox.h> 50 #include <wx/button.h> 52 #include <wx/bitmap.h> 53 #include <wx/msgdlg.h> 54 #include <wx/textctrl.h> 55 #include <wx/filedlg.h> 56 #include <wx/arrstr.h> 68

SetDataObject(

new

wxFileDataObject);

77

wxFileDataObject *dobj = (wxFileDataObject *)m_dataObject;

78

wxArrayString

filenames

= dobj->GetFilenames();

82  if

(def == wxDragMove || def == wxDragLink) {

85

}

else if

(def == wxDragCopy) {

119 

wxPanel::Create( parent,

id

, pos,

size

, style );

124

GetSizer()->SetSizeHints(

this

);

160

wxStaticBox* itemStaticBoxSizer3Static =

new

wxStaticBox(itemPanel1,

wxID_ANY

,

_

(

"BAM/CSRA Files or SRA Run Accessions"

));

161

wxStaticBoxSizer* itemStaticBoxSizer3 =

new

wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);

162  m_MainSizer

->Add(itemStaticBoxSizer3, 1, wxGROW|wxALL, 5);

164

wxBoxSizer* itemBoxSizer4 =

new

wxBoxSizer(wxVERTICAL);

165

itemStaticBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);

167  m_BamInput

=

new CRichTextCtrl

( itemStaticBoxSizer3->GetStaticBox(),

ID_BAM_INPUT

, wxEmptyString, wxDefaultPosition, wxSize(200, 100), wxTE_MULTILINE|wxTE_RICH2|wxWANTS_CHARS );

168

itemBoxSizer4->Add(

m_BamInput

, 1, wxGROW|wxALL, 5);

170

wxButton* itemButton6 =

new

wxButton( itemStaticBoxSizer3->GetStaticBox(),

ID_BUTTON

,

_

(

"Add BAM/CSRA Files"

), wxDefaultPosition, wxDefaultSize, 0 );

171

itemBoxSizer4->Add(itemButton6, 0, wxALIGN_RIGHT|wxALL, 5);

173

wxStaticText* itemStaticText7 =

new

wxStaticText( itemStaticBoxSizer3->GetStaticBox(), wxID_STATIC,

_

(

"For viewing a BAM file, an index file is required residing in \nthe same directory as the BAM file. The index file should \nbe named by appending \".bai\" or \".csi\" to the bam file\nname.\n\nIn cases of multiple inputs, the inputs must be separated \nby one of these separators: commas(,), semicolons(;), or \nnew lines."

), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );

174

itemStaticBoxSizer3->Add(itemStaticText7, 0, wxALIGN_LEFT|wxALL, 5);

176

itemStaticBoxSizer3->Add(5, 5, 1, wxGROW|wxALL, 5);

183

wxStaticText* parsingText =

new

wxStaticText(

this

,

ID_PARSING_TEXT

,

wxT

(

"Validating accessions ..."

), wxDefaultPosition, wxDefaultSize, 0);

184

wxFont bold(wxNORMAL_FONT->GetPointSize(), wxNORMAL_FONT->GetFamily(), wxNORMAL_FONT->GetStyle(), wxFONTWEIGHT_BOLD, wxNORMAL_FONT->GetUnderlined(), wxNORMAL_FONT->GetFaceName());

185

parsingText->SetFont(bold);

186

parsingText->SetForegroundColour(*wxBLACK);

195  m_ErrStyle

.SetBackgroundColour(wxColour(255, 200, 200));

215 #define BAM_LOADER_ERR "Bam - Error in input" 217 #define INVALID_INPUT "Input contains no valid BAM file/SRA Run accession or no corresponding \ 220 #define EMPTY_INPUT "Please specify BAM files or SRA Run accessions to load!" 237

wxOK | wxICON_ERROR,

this

);

241

wxOK | wxICON_ERROR,

this

);

244  string

err_msg =

"Input contains invalid BAM files or SRZ accessions ("

;

246

err_msg +=

"\nWould you like to proceed?"

;

249

wxYES_NO | wxICON_EXCLAMATION,

this

);

266  string

header =

"User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; " 267  "Windows NT 5.0; (R1 1.1))"

;

272  if

(

nullptr

== net_info) {

277

net_info->max_try = 1;

278

net_info->timeout = &Timeout;

297  if

(

nullptr

!= net_info)

306  const

vector<string> index_exts{

".bai"

,

".csi"

};

309  string

path,

file

, ext;

311  for

(

const auto

& index_ext: index_exts) {

313  string

index_name =

file

+ ext + index_ext;

315

iter.second = path + index_name;

318

index_name =

file

+ index_ext;

320

iter.second = path + index_name;

325  if

(

CFile

(path +

file

+ ext + index_ext).Exists()) {

326

iter.second = path +

file

+ ext + index_ext;

329  if

(

CFile

(path +

file

+ index_ext).Exists()) {

330

iter.second = path +

file

+ index_ext;

335  if

(iter.second.empty())

356

objects::CSrzPath srz_path;

357  string

path = srz_path.FindAccPath(srz_acc);

365

objects::CVDBMgr sra_path;

366  string

path = sra_path.FindAccPath(srz_acc);

382

vector<pair<string, string>> bamFiles;

390

SParseResults s_ValidateInput(

const string

&

input

,

ICanceled

& canceled)

392  static string sDelim

(

",;\n\r"

);

399

vector<string> tokens;

400

vector<SIZE_TYPE> token_pos;

402  size_t

token_num = tokens.size();

404  for

(

size_t i

= 0;

i

< token_num; ++

i

) {

407  return

SParseResults();

409  string

input_str = tokens[

i

];

414  if

(

file

.Exists()) {

418  results

.csraFiles.insert(input_str);

421  auto

it = find_if(

results

.bamFiles.begin(),

results

.bamFiles.end(),

422

[&input_str](

const

pair<string,string>& v) { return v.first == input_str;});

423  if

(it ==

results

.bamFiles.end())

424  results

.bamFiles.emplace_back(input_str,

""

);

436  auto

it = find_if(

results

.bamFiles.begin(),

results

.bamFiles.end(),

437

[&input_str](

const

pair<string, string>& v) { return v.first == input_str; });

438  if

(it ==

results

.bamFiles.end())

439  results

.bamFiles.emplace_back(input_str,

""

);

442  results

.csraFiles.insert(input_str);

460  results

.errPos.push_back((

int

)token_pos[

i

]);

461  results

.errPos.push_back((

int

)(token_pos[

i

] + tokens[

i

].size()));

475

wxStaticText* parsingText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_PARSING_TEXT

));

476

parsingText->SetLabelText(

"Canceling validation ..."

);

477

parsingText->SetForegroundColour(*wxBLACK);

504

wxStaticText* parsingText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_PARSING_TEXT

));

505

parsingText->SetLabelText(

"Validating accessions ..."

);

506

parsingText->SetForegroundColour(*wxBLACK);

519  return

s_ValidateInput(

text

, canceled);

523

SParseResults parseResults;

526

parseResults = future();

535  if

(parseResults.errPos.size() > 1) {

543  for

(

size_t i

= 0;

i

< parseResults.errPos.size() - 1; ++

i

)

551  catch

(

const

exception& e) {

557  if

(!errMsg.empty()) {

558

wxStaticText* parsingText =

dynamic_cast<

wxStaticText*

>

(FindWindow(

ID_PARSING_TEXT

));

559

parsingText->SetLabelText(

"Parse error: "

+ errMsg);

560

parsingText->SetForegroundColour(*wxRED);

569

},

"Validating accessions..."

)

644  string

old_path(

m_BamInput

->GetValue().ToUTF8());

648

wxFileDialog dlg(

this

,

wxT

(

"Select BAM files"

), wxString::FromUTF8(def_path.c_str()),

wxT

(

""

),

649

wxString(

wxT

(

"BAM files|*.bam|"

)) + wxALL_FILES,

652  if

(dlg.ShowModal() != wxID_OK)

664  if

( !

str

.IsEmpty() ) {

676  if

( !

str

.IsEmpty() ) {

static bool x_IsUrlAccessible(const string &url)

This stream exchanges data with an HTTP server located at the URL: http[s]://host[:port]/path[?...

Class implements different ad-hoc unreliable file format identifications.

EFormat

The formats are checked in the same order as declared here.

@ eSra

INSDC Sequence Read Archive file.

CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional keyboard events (such as Clipboa...

Interface for testing cancellation request in a long lasting operation.

static const char * str(char *buf, int n)

int GetStatusCode(void) const

Get the last seen HTTP status code, if available.

@ fHTTP_AdjustOnRedirect

Call adjust routine for redirects, too.

@ fHTTP_AutoReconnect

See HTTP_CreateConnectorEx()

@ fHTTP_UnsafeRedirects

Any redirect will be honored.

const string & GetMsg(void) const

Get message string.

virtual const char * what(void) const noexcept

Standard report (includes full backlog).

static void SplitPath(const string &path, string *dir=0, string *base=0, string *ext=0)

Split a path string into its basic components.

void OnTimer(wxTimerEvent &event)

void SetInput(const string &input)

void SetFilenames(const wxArrayString &filenames)

wxIcon GetIconResource(const wxString &name)

Retrieves icon resources.

size_t m_ErrNum

number of token with errors

void OnBamInputTextUpdated(wxCommandEvent &event)

wxEVT_COMMAND_TEXT_UPDATED event handler for ID_BAM_INPUT

const TBamFiles & GetSraAccs() const

CRichTextCtrl * m_BamInput

void OnButtonClick(wxCommandEvent &event)

wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON

virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)

bool Create(wxWindow *parent, wxWindowID id=ID_CBAMLOADOPTIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)

const TBamWithIndexFiles & GetBamFiles() const

size_t m_InputNum

total number of valid inputs

vector< pair< string, string > > TBamWithIndexFiles

CDropTarget(CBamLoadOptionPanel &panel)

wxBitmap GetBitmapResource(const wxString &name)

Retrieves bitmap resources.

std::unique_ptr< async_job > m_ValidateJob

TBamWithIndexFiles m_BamFiles

wxBoxSizer * m_ParseProgressSizer

static bool ShowToolTips()

const TBamFiles & GetCSraFiles() const

const TBamFiles & GetSrzAccs() const

void AddFilenames(const wxArrayString &filenames)

string GetBamFilePath() const

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

virtual bool IsCanceled(void) const =0

bool NcbiStreamCopy(CNcbiOstream &os, CNcbiIstream &is)

Copy the entire contents of stream "is" to stream "os".

static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)

Convert size_t to string.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

@ eNocase

Case insensitive compare.

SConnNetInfo * ConnNetInfo_Create(const char *service)

void ConnNetInfo_Destroy(SConnNetInfo *net_info)

The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format

job_function_traits< _Fty >::future job_async(const _Fty &_Fnarg, const string &descr)

static void text(MDB_val *v)

const struct ncbi::grid::netcache::search::fields::SIZE size

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

static string sDelim(" \t\n,;")

FAccType operator()(const string &srz_acc)

wxString ToWxString(const string &s)


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