Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • zisis86
    Member
    • Mar 2013
    • 10

    Help with script that seperates reads from fastq file

    hi,
    I have fastq files of reads and i would like to finish this script in order to select the "good" reads from the "bad" reads and after that to save my results in new fastq files(good.fastq bad.fastq) .
    Thanks for the help

    gc()
    rm(list=ls())
    library(ShortRead)
    showMethods(readFastq)
    showMethods(writeFastq)
    library(Biostrings)

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

    #choose case
    num <- 1
    exptPath <- ("Downloads/INDEX1_reads.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)

    # save "good" reads from from fuzzy match in "*.good.fq" file and "bad" reads in *".bad.fq" file


    ?????

Latest Articles

Collapse

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by SEQadmin2, Today, 10:09 AM
0 responses
9 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, Yesterday, 08:59 AM
0 responses
14 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-02-2026, 12:03 PM
0 responses
23 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 06-02-2026, 11:40 AM
0 responses
20 views
0 reactions
Last Post SEQadmin2  
Working...