Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • N ngs_tools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • bioinfo
  • ngs_tools
  • Issues
  • #71

Closed
Open
Created Sep 09, 2019 by domingue@domingueMaintainer

Grep error message crashes the script

This function also has a grep related error:


readBaseQualDist = function(statsFile){
    # statsFile="./fastqc/mouse_big_cyst_rep2_fastqc/fastqc_data.txt"
    # statsFile="./fastqc/mouse_liver_polar_stage3_rep2_fastqc/fastqc_data.txt"
    # grep -A30 -F '>>Per base sequence quality' /Volumes/projects/bioinfo/holger/projects/helin/mouse/fastqc/mouse_big_cyst_rep1_fastqc/fastqc_data.txt | grep -B100 -F '>>END_M' | head -n-1 | tail -n+2 | tr '#' ' '
#    echo("reading", statsFile)

    baseStats = read.delim(pipe(
        #http://stackoverflow.com/questions/1946363/how-do-i-display-data-from-the-beginning-of-a-file-until-the-first-occurence-of/1947950#1947950
        paste(get_zip_pipe(statsFile, "fastqc_data.txt"), " | grep -A200 -F '>>Per base sequence quality' |  perl -pe 'last if />>END_MODULE/' | head -n-2 | tail -n+2 | tr '#' ' '")
        )) %>% mutate(
            run=trim_ext(basename(statsFile), ".zip")
        )

    baseStats %>% mutate(base_order=1:n())
}
grep: write error: Broken pipe

In this line. Here the issue has detailed elsewhere:

grep is complaining because it has more output than 10 lines, and head is cutting it off before it finishes I suggest hiding grep's stderr output (this is where the broken pipe error is printed).

I will try this.

Assignee
Assign to
Time tracking