Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing arguments with ‘arg’ from a file
    primarykey
    data
    text
    <p>I'm starting with bash code and I'm a bit lost with one script. First of all I would like to say that I have read this post <a href="https://stackoverflow.com/questions/9883576/parse-args-that-arent-declared">Parse Args that aren&#39;t declared</a> but It hasn't helped me.</p> <p>I have a file (affy.txt) with 9 columns and 6 rows. In the first column there are the gene's names and in the others numeric values from an experiment. My objective is to calculate the max, min and mean from the results from only one of all genes (ej: gene2 named ABC). Further, I would like to estimating the max, min and mean from only a column too.</p> <p>I have created some code...</p> <pre><code>#!/bin/bash echo This script runs the follow options over affy.txt echo OPTIONS: echo -a Find a gene and its tests\' result echo -b Analyze one column\'s result echo Write an option, and beside it, the name of the gene or the number of the column you are looking \for: read OPTION for arg; do case "$1" in $OPTION -a) shift grep -n $1 affy.txt;; gene="$1";; -b) shift [0-9]*) col+="${1#-}"",";; #I'm not sure if -b) sintaxys it's ok esac shift done echo col="$col" gene="$gene" </code></pre> <p>Now I'm only focusing with It. I have created a code for my next step, estimation of the max, min and mean of the gene or column. But I don't care it now, I write it here to help you to understand the idea of the script.</p> <pre><code>#if [ "$col" = "" ]; #then echo "Insert Columns please!" #else #for i in $col; do #echo #echo minim columna "$i"= `grep "$gene" affy.txt | cut -d ' ' -f"$i" | sort -n | head -1` #echo maxim columna "$i"= `grep "$gene" affy.txt | cut -d ' ' -f"$i" | sort -n | tail -1` #echo average columna "$i"= `grep "$gene" affy.txt | cut -d ' ' -f"$i" | awk '{sum+=$1} END {print sum/NR}'` #shift #done #fi </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload