Tuesday, February 8, 2011

command line options in R: "optparse" package

C/python style option parsing now available in R with "optparse" package. Check the documentation here and see below to see how it works


user@node002 scripts $ Rscript filter.transcripts.by.ncRNA.R -h
usage:  usage: filter.transcripts.by.ncRNA.R [options]

options:

    -i INPUTFILE, --inputfile=INPUTFILE
        a BED12 file with transcripts [default /home/user/tx.db.bed]


    -o OUTPUTPATH, --outputpath=OUTPUTPATH
        /output/path/string to be used for output files [default "/home/user/projects/
transcripts"]

    -a ANNOTATION, --annotation=ANNOTATION
        annotation BED12 file containing  ncRNA locations [default /home/user/projects/
annotations/frna.db.hg18.bed]

    -h, --help
        Show this help message and exit

1 comment:

  1. I reach this post trying to find out about these statements from the methylkit manual:

    "# read-in transcript locations to be used in annotation
    # IMPORTANT: annotation files that come with the package (version >=0.5) are a subset of full annotation files.
    # Download appropriate annotation files from UCSC (or other sources) in BED format"

    Would you please help me finding such files to use them in my analysis.

    Thanks in advance

    ReplyDelete