Skip to content

Instantly share code, notes, and snippets.

@aseetharam
Created September 11, 2015 01:34
Show Gist options
  • Save aseetharam/0b0ce858e49040adb2b9 to your computer and use it in GitHub Desktop.
Save aseetharam/0b0ce858e49040adb2b9 to your computer and use it in GitHub Desktop.
#!/bin/bash
num=1
while read line; do
start=$(echo $line |cut -f 1 -d ",");
end=$(echo $line |cut -f 2 -d ",");
strand=$(echo $line |cut -f 3 -d ",");
if [ "$strand" = "+" ]; then
echo -e "253771435\t$((start - 3))\t${start}\t${num}\t0\t+";
else
echo -e "253771435\t$((${end} - 1))\t$((${end} + 2))\t${num}\t0\t-"
fi
((num++))
done<$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment