SLIDESORT is also available as C++ library.

**Availability [#tfd3f40a]
Goto [[Download]] site.

**How to call libSlideSort [#s7eef668]
- Similar pairs are obtained from call-back function which is defined by user.
- Return value and arguments of the call-back function are as follows.
  int UserDefFuncName(const char* fasta_head1, const char* fasta_head2, int seqid1, int seqid2, char* aln1, char* aln2, double dist, int aln_size);
  int UserDefFuncName(const char* fasta_head1, const char* fasta_head2, TYPE_INDEX seqid1, TYPE_INDEX seqid2, char* aln1, char* aln2, double dist, int aln_size);

-- TYPE_INDEX is "unsigned int" for 4G package, "long long" for LL package.

-- fasta_head1: fasta header of a seqyence of the similar pair.
-- fasta_head2: fasta header of the other sequence.
-- seqid1: internal id of a seqyence of the similar pair. 
-- seqid2; internal id of the other sequence.
-- Sequence name is obtained by object_name.sq.seqName[ internal_id ].
-- aln1: alignment of seq1.
-- aln2: alignment of seq2.
-- dist: edit/hamming distance of the similar pair.
-- aln_size: length of the alignment

- Important point 1...
If your program is executed without option "-a", aln1, aln2 and aln_size become NULL.
So, use "-a" to obtain alignment information.
- Important point 2...
To avoid disk access overhead caused by output of large number of similar pairs, I recommend to use "-l" option. 

- An examble of source code
-- int UserDefFuncName(const char* head1, const char* head2, int seqid1, int seqid2, char* aln1, char* aln2, double dist, int aln_size){
-- cerr<<seqid1<<" - "<<seqid2<<" : "<<dist<<"\n";
-- return(0);
-- }

-- void main(int argc, char** argv){
-- GETRESFUNC infptr = &UserDefFuncName;
-- multisort ml;
-- ml.setResGetFuncPtr(infptr);
-- ml.getParam(argc, argv);
-- ml.exec();
-- }
Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes