Header Leaderboard Ad

Collapse

Usage of writeFastq function from ShortRead

Collapse

Announcement

Collapse

SEQanswers June Challenge Has Begun!

The competition has begun! We're giving away a $50 Amazon gift card to the member who answers the most questions on our site during the month. We want to encourage our community members to share their knowledge and help each other out by answering questions related to sequencing technologies, genomics, and bioinformatics. The competition is open to all members of the site, and the winner will be announced at the beginning of July. Best of luck!

For a list of the official rules, visit (https://www.seqanswers.com/forum/sit...wledge-and-win)
See more
See less
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • zisis86
    started a topic Usage of writeFastq function from ShortRead

    Usage of writeFastq function from ShortRead

    Hi,
    I am totaly new and i have a question about the syntax of writeFastq function.
    I have this script that search for primer sequences in a file and saves good reads from fuzzy in .good.fq file and bad reads in .bad.fq file> i want to use writeFastq functions from ShortRead package to save "good" reads from fuzzy match in "*.good.fq" file and "bad" reads in *".bad.fq" file.Can you help me with the code that i have to fill in in order to do this .
    here is my code until now.

    gc()
    rm(list=ls())
    library(ShortRead)
    #library(Biostrings)

    #read bait sequences
    baitseq <- readLines("/home/users/bait_seq.txt")
    baitseq

    #choose case
    num <- 1
    exptPath <- "/home/users/INDEX1.fastq"
    exptPath

    #read data
    fq <- readFastq(dirPath=exptPath)
    sread(fq)

    #count ocurrences of bait
    pos <- grepl(baitseq[num],sread(fq))
    pos[1:25]
    # number of reads
    length(pos)
    # number of hits
    sum(pos)

    # fuzzy match - 2 substitutions
    fpos <- agrep(baitseq[num],sread(fq), max = list(sub = 2, ins=0, del=0))
    fpos[1:25]
    # number of fuzzy hits
    length(fpos)

    # writeFastq functions in ShortRead package to save "good" reads from fuzzy match in "*.good.fq" file and "bad" reads in *".bad.fq" file # ???????
    ............


    #tables
    #table <- tables(sread(fq), n=5)
    #table$top
    Last edited by zisis86; 10-20-2013, 11:32 PM.

Latest Articles

Collapse

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, Today, 07:14 AM
0 responses
4 views
0 likes
Last Post seqadmin  
Started by seqadmin, Yesterday, 01:08 PM
0 responses
6 views
0 likes
Last Post seqadmin  
Started by seqadmin, 06-01-2023, 08:56 PM
0 responses
40 views
0 likes
Last Post seqadmin  
Started by seqadmin, 06-01-2023, 07:33 AM
0 responses
177 views
0 likes
Last Post seqadmin  
Working...
X