Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from moka-guys/development
Browse files Browse the repository at this point in the history
Add script to report number of fastqs in runfolder
  • Loading branch information
andyb3 authored Dec 18, 2018
2 parents 5795f72 + 293d585 commit 90c8536
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Workstation Housekeeping
Scripts to manage data on the NGS workstation

---

## backup_runfolder.py v1.0
Uploads an Illumina runfolder to DNANexus.

Expand All @@ -19,3 +21,16 @@ This tool requires the DNAnexus utilities `ua` (upload agent) and `dx` (DNAnexus
* From a list of files in the runfolder, files matching any of the comma-separated strings passed to `--ignore` are removed. The default is '/L00', which ignores BCL files in directories with this prefix. To upload all files in a runfolder, pass the argument `--ignore ""`.
* Finally, each remaining file is passed to the DNAnexus `ua` utility. This will attempt an upload if the files are not found in the expected location in the DNAnexus project. The number of upload tries is set to 100 with the `--tries` flag.
* Logs from this and the script are written to STDERR and a logfile, named after the runfolder. A destination for this file can be passed to the `--logpath` flag.

---

## findfastqs.sh
Report the number of gzipped fastq files in an Illumina runfolder.

### Usage
```
$ findfastqs.sh RUNFOLDER
>>> RUNFOLDER has 156 demultiplexed fastq files with 2 undetermined. Total: 158
```

---
15 changes: 15 additions & 0 deletions findfastqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Commands to help with runfolder managemenet (Nana)
findfastqs(){
input_directory=$1
# Find all fastqs in the input directory.
# Grep -v filters out undetermined fastqs from this list, which are not typically uploaded to DNAnexus
numfqs=$(find $input_directory -iname "*.fastq.gz" | grep -v "Undetermined" | wc -l);
# Count the number of undetermined fastqs in input directory
undetermined=$(find $1 -iname "Undetermined*.fastq.gz" | wc -l);
total=$((numfqs + undetermined))
echo "$input_directory has $numfqs demultiplexed fastq files with $undetermined undetermined. Total: $total";
}

findfastqs $1

0 comments on commit 90c8536

Please sign in to comment.