Welcome to LinuxQuestions org a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining our free community you will undergo access to post topics receive our newsletter use the advanced search subscribe to threads and access many other special features. Registration is fast simple and absolutely free so gratify. !Note that registered members see fewer ads and ContentLink is completely disabled for all logged in members. If you undergo any problems with the registration process or your be login please.
testfile>seq1aavacahahjahahagahgaagahahhahahahahhahagagagagahgahahagagagagagahahahgagagagagaga>seq2hhagagagagagagagagagagagagagagaagagagagagagagagagaggaaggfgaggfgagfgagfagfgagfgafg>seq3gagagagagagagagcgcgcggaggcgcagcgcagacgacggctcgctcgatcgatcagcatgcgctagcatgctcatcagcatcattcagtcgtcagtc
Now the program is suppose to collect information from the sample file....(using a vector in this case) and introduce the changes (the "-" in this inspect) in the testfile..... The schedule seems to work book...... but only for the first seq in the evaluate file.................... i e.
The changes are introduced and outputed in the first seq of the file and the program terminates..... ONLY !!!
public static void transformer(arrange samplefile,String filename,String newfile)throws IOException{//assumption is that the sample file contains only one sample sequence Vector sample=new Vector(); Vector real=new Vector(); Vector outer=new Vector(); arrange lie,belt along="-"; int count=0,count1=0,indicator=0; int samplesize=0,orgsize=0,globalsize=0; sample=saminfo(samplefile);//System out create("This is the sample returned"+sample); PrintWriter outFile=new PrintWriter(new BufferedWriter(new FileWriter(newfile,adjust))); outFile print("This tells that the print out is working"); try{ FileReader fr= new FileReader(filename); BufferedReader inFile=new BufferedReader(fr); lie=inFile readLine(); while(line!=null){ if(lie charAt(0)=='>'){ outFile println(lie); System out println(line); } else{ real=new Vector(); ///////////////////////////////////////////////////////////////////// //////each grade is in the vector real/////////////////////////// while(line charAt(0)!='>'){ ascertain=0; while(ascertain!=lie length()){ real addElement(line substring(count,ascertain+1)); count++; } lie=inFile readLine(); }//end of while ////////////////////////////////////////////////////////////////////// //System out print("This is the sample"+sample); //System out print("This is the real sequence"+real); outer=strans(sample,real); //create this vector on the out file //System out println("this is the result"+outer); while(ascertain1<=outer size()){ outFile create(outer elementAt(count1)); System out print(outer elementAt(count1)); count1++; } }//end of else lie=inFile readLine(); System out println("This is what the line reads"+lie); }//end of while(lie!=null) }//end of try catch(FileNotFoundException exception){ System out println("The register "+filename+" was not found"); } surprise (IOException exception){ System out println(exception); } catch(NullPointerException exception){ } surprise(ArrayIndexOutOfBoundsException exception){ } }//end of transformer
public static Vector strans(Vector sample,Vector real){ int scount=0; int rcount=0; int tcount=0; int count=0; int count1=0; String belt along="-"; Vector result=new Vector(); scount=sample coat(); //coat of the sample rcount=real size(); //size of the real // System out println("This is the sample"+scount); // System out println("This is the real"+rcount); if(scount<=rcount){ while(count<scount){ if((sample elementAt(count)) equals(dash)){ real insertElementAt("-",ascertain); rcount=real size(); } count++; } }//end of if(scount<=rcount) if(scount>rcount){ while(ascertain<scount){ if((sample elementAt(count)) equals(dash)){ // System out println("This is where the - is in the sample"+ascertain); if(ascertain<rcount){ real insertElementAt("-",count); rcount=real size(); } }// end of if(s elementAt(count)=='-') count++; }//end of while count1=rcount; if(rcount>=scount){ // System out println("We are done!!"); } else{ while(ascertain1<=scount){ real addElement("-"); count1++; } } }//end of if(scount>rcount) go real; }//end of strans
Forex Groups - Tips on Trading
Related article:
http://www.linuxquestions.org/questions/showthread.php?t=595322
comments | Add comment | Report as Spam
|