[Biojava-l] Need help for resolving the issue args[0]

mark.schreiber at novartis.com mark.schreiber at novartis.com
Fri Jun 19 06:57:09 UTC 2009


Can you post the stack trace?



biojava-l-bounces at lists.open-bio.org wrote on 06/19/2009 02:52:38 PM:

>  Hello Support,
> I am a new developer of biojava, I have a good knowledge about java and 
bio,
> but this is new tool for me, I have some problem while working in this
> tools, below I have write down the code for reading the Gen Bank file 
and
> then convert into "DNA", "RNA" or "Protein". I have already add the 
biojava
> library into my source code. When I have read this code I have come to 
know
> from your arguments portion for the execution of this code, I have need
> three argument, one for the filename, second for the file type and third 
is
> the alphabet.
> Now the problem is that how I will pass these three parameter values 
into
> source code for args[0], args[1] and args[2]. When I have passed these
> values by using the string pattern then this code generte a errors, 
"illegel
> statement". Please help me out how I can fixed this problem, I will be 
very
> thankful to you if you will reply me soon
> 
> 
> package biojava;
> import java.io.*;
> 
> import org.biojava.bio.*;
> import org.biojava.bio.seq.*;
> import org.biojava.bio.seq.io.*;
> 
> public class ReadFasta2 {
> 
>  /**
>   * This program will read any file supported by SeqIOTools it takes 
three
>   * arguments, the first is the file name the second is the name of
>   * a file format supported by SeqIOTools. eg fasta, genbank etc.
>   * The third argument is the alphabet (eg dna, rna, protein).
>   *
>   * Both the format and alphabet names are case insensitive.
>   *
>   */
>  public static void main(String[] args) {
>    try {
>      //prepare a BufferedReader for file io
>      BufferedReader br = new BufferedReader(new FileReader(args[0]));
> 
>      String format = args[1];
>      String alphabet = args[2];
> 
>      /*
>       * get a Sequence Iterator over all the sequences in the file.
>       * SeqIOTools.fileToBiojava() returns an Object. If the file read
>       * is an alignment format like MSF and Alignment object is returned
>       * otherwise a SequenceIterator is returned.
>       */
>      SequenceIterator iter =
>          (SequenceIterator)SeqIOTools.fileToBiojava(format,alphabet, 
br);
>    }
>    catch (FileNotFoundException ex) {
>      //can't find file specified by args[0]
>      ex.printStackTrace();
>    }catch (BioException ex) {
>      //error parsing requested format
>      ex.printStackTrace();
>    }
>  }
> }
> --
> 
> 
> 
> 
> -- 
> Abdul Qaddus
> www.futurelinkers.com
> Cell No:- +92-3336540863
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l

_________________________

CONFIDENTIALITY NOTICE

The information contained in this e-mail message is intended only for the 
exclusive use of the individual or entity named above and may contain 
information that is privileged, confidential or exempt from disclosure 
under applicable law. If the reader of this message is not the intended 
recipient, or the employee or agent responsible for delivery of the 
message to the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, please 
notify the sender immediately by e-mail and delete the material from any 
computer.  Thank you.



More information about the Biojava-l mailing list