NCBI-Hackathons / seqr

Creative Commons Zero v1.0 Universal
12 stars 2 forks source link

SEQR Internal API stuff #3

Closed crashfrog closed 8 years ago

crashfrog commented 8 years ago

Hi all, I'm putting up a thread to keep track of module-to-module interfaces. This is the place for you to document the class and method signature for your module's point of entry, and any parameters you need from the command-line interface. Additionally it's a list of static methods you can grab from the Seqr class itself, for sideband access to various global parameters.

If you need more statics than are listed here, ask me and I'll add em.

crashfrog commented 8 years ago

Statics: public static SolrServer getSolrServer public static String getOutputPath

sadahanu commented 8 years ago

Here are my two classes:

Public Class: tokenkey

import java.util.*;

private char []tk; private int l; // the number of letters in one token key // in case we are looking for other combinations public tokenkey(String str) // generate char[] from input 5-letter string (AAAAC)

public tokenkey(char[] token)
  // it turns out that BufferedReader Method can take a char[]

public tokenkey()
  // default constructor

public boolean isFullkey()
    // check whether the key has five letters

public Integer getKey(Hashtable<Character,Integer> ptable)
    //ptable is a hashtable: A,C,D,E,F,G,H,I,K,L,M,N,P,Q,R,S,T,V,W,Y

convert to 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 // can be replaced for tables for other types of sequences //if one letter is not a valid protein letter; return null // other wise return the key to retrieve the index number from the index file

Public Class: findindex Requires class token key args[0]: inputs sequence file; args[1] : index file output to standard output stream: index

Best Regards,

Zhou Yu

On Tue, Aug 4, 2015 at 11:51 AM, Justin Payne notifications@github.com wrote:

Statics: public static SolrServer getSolrServer public static String getOutputPath

— Reply to this email directly or view it on GitHub https://github.com/DCGenomics/seqr_hackathon_v002/issues/3#issuecomment-127656440 .

sadahanu commented 8 years ago

I updated the structure of the findindex class

import java.nio.channels.FileChannel; import java.nio.MappedByteBuffer; import java.nio.ByteOrder; import java.io.RandomAccessFile; import java.io.IOException; import java.util.*; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.File; import java.io.Reader;

public class findindex

public findindex(String s) //construct the index from the input sequence //s is the input file name ////construct findindex based on a hash table //ptable is: A,C,D,E,F,G,H,I,K,L,M,N,P,Q,R,S,T,V,W,Y convert to 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19

public findindex() // default constructor

public int[] getIndex(String s) //s: the file name of the *.index // return the index as int[]

public int[] getIndex(MappedByteBuffer m) // a more efficient way to build the index.Different findindex objects can share the same byte buffer.

nabihlme commented 8 years ago

Output out = new Output(outstream, outputCode, outputFields); for(SolrDocument sd : List sds) { out.write(sd); }

I need more information for the header in the output file. SEQR Version SOLR Version Query Name Database Name Number of hits SOLR found

How should we throw around this info? Right now you can just call a method and give it all the info. out.writeHeader( String versionSeqr, String versionSolr, String queryName, String databaseName, List fields, int hits);

Or I could write something to go looking for it, if it is static in the main program.

averagehat commented 8 years ago

Closing this for now, feel free to re-open if it seems appropriate