Sponsored Content
Top Forums Shell Programming and Scripting Help with shell script - not finding files Post 302873259 by wmelroy on Monday 11th of November 2013 01:56:20 PM
Old 11-11-2013
Help with shell script - not finding files

Hello,

I have a shell script like the one below but cannot get it working:
Code:
#!/bin/bash
#$ -cwd

CHR=$2
 
# directories
ROOT_DIR=./
RESULTS_DIR=${ROOT_DIR}results/
 
# executable
SHAPEIT_EXEC=${ROOT_DIR}shapeit.v2.r727.linux.x64/shapeit.v2.r727.linux.x64
 
# parameters
THREAT=5
EFFECTIVESIZE=11418
 
# reference data files
GENMAP_FILE=/home/whme1016/Imputation/genetic_map_b37/genetic_map_chr${CHR}_combined_b37.txt
 
# GWAS data files in PLINK BED format
GWASDATA_BED=${ROOT_DIR}chr${CHR}.unphased.bed
GWASDATA_BIM=${ROOT_DIR}chr${CHR}.unphased.bim
GWASDATA_FAM=${ROOT_DIR}chr${CHR}.unphased.fam

# problem SNP file
EXCLUDE_SNP=${ROOT_DIR}chr${CHR}.alignments.snp.strand.exclude
 
# main output file
OUTPUT_HAPS=${RESULTS_DIR}chr${CHR}.phased.haps
OUTPUT_SAMPLE=${RESULTS_DIR}chr${CHR}.phased.sample
OUTPUT_LOG=${RESULTS_DIR}chr${CHR}.phased.log
 
## phase GWAS genotypes
$SHAPEIT_EXEC \
--input-bed $GWASDATA_BED $GWASDATA_BIM $GWASDATA_FAM \
--input-map $GENMAP_FILE \
--exclude-snp $EXCLUDE_SNP \
--thread $THREAT \
--effective-size $EFFECTIVESIZE \
--output-max $OUTPUT_HAPS $OUTPUT_SAMPLE \
--output-log $OUTPUT_LOG

done

I am trying to run a program called SHAPEIT. When I run the shell script, I get the following error:
Code:
Segmented HAPlotype Estimation & Imputation Tool
  * Authors : Joe BLOGGS
  * Contact : someone@somewhere.com
  * Webpage : http:://www.example.fr
  * Version : v2.r727
ERROR: [./chr.alignments.snp.strand.exclude] is impossible to open, check file existence or reading permissions

I have the following files in my root directory for chromosome 2 with full permissions:
Code:
chr2.alignments.log                 
chr2.alignments.snp.strand        
chr2.alignments.snp.strand.exclude 
chr2.unphased.bed                   
chr2.unphased.bim                   
chr2.unphased.fam                   
chr2.unphased.log

My shell script is clearly reading the chr2.unphased.fam/bed/bim files, but not my chr2.alignments.snp.strand.exclude. Any ideas why this is? Thanks for any help.

Last edited by Scott; 11-11-2013 at 02:58 PM.. Reason: Add code tags; obfuscate data
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix shell script for finding top ten files of maximum size

I need to write a Unix shell script which will list top 10 files in a directory tree on basis of size. i.e. first file should be the biggest in the whole directory and all its sub directories. Please suggest any ideas (10 Replies)
Discussion started by: abhilashnair
10 Replies

2. Shell Programming and Scripting

need help in finding a string and to send an email using shell script

Hi All i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person This is basically to find the encrypetd keys which are loaded in the unix server Below are sample... (10 Replies)
Discussion started by: ranga27
10 Replies

3. Shell Programming and Scripting

Finding all script files

Hello All, After a HDD crash, I would like to selectively back up all my script files. What is the most efficient way to do this? The pseudo code I was thinking of was something like this: for a in `find ./ -name "*"` do if (file $a) == Bourne|Tcsh|... then echo $a >>... (7 Replies)
Discussion started by: pru
7 Replies

4. Red Hat

Need help with a shell script for finding a certain pattern from log file

Hell Guys, Being a newbie, I need some help in finding a certain string from a log file of thousands of lines (around 30K lines) and have the output in a separate file. Below is the file output - 10.155.65.5 - - "POST... (15 Replies)
Discussion started by: rockf1bull
15 Replies

5. Shell Programming and Scripting

shell script for finding average runtime of other script

so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies

6. UNIX for Dummies Questions & Answers

Shell script - Finding Autosys job status

Hi, There are 2000 jobs in the list and i need to draw their status. I put all the jobs in the list and trying to read one by one from the list and to find out the status. Help me out in correcting the script. #!/bin/csh for a in $(cat Jobs_List.txt); do source <<path>> autorep -j $a... (1 Reply)
Discussion started by: venkatesht
1 Replies

7. Answers to Frequently Asked Questions

Finding the nth Particular Week in a Month – shell script

I see lot of request posted in internet to find out the day of nth week in a Month. example: what is the date of 3rd Sunday in October What is the date of 2nd Friday in June 2012 what is the date of 4th Saturday in January 2011..etc.. The below shell script is used to find out the... (1 Reply)
Discussion started by: itkamaraj
1 Replies

8. Shell Programming and Scripting

Need help in finding and copying list of files using bash shell script

Dear All, I have a situation where I want to copy some files of type .txt. These files are o/p from one program. Some of the files are named as fileName .txt instead of fileName.txt after fileName by mistake I have specified "space". Now I want to move these files as follows. mv fileName*... (13 Replies)
Discussion started by: linuxUser_
13 Replies

9. Shell Programming and Scripting

Finding file extension on C Shell script

I very new to C Shell. I am trying to do is read from Command line. Find the if the file is zip, .txt, symbloic link,pipe, unknow (if file is not zip, txt, sy....) here is what I what got so far. I am very stuck atm Please help me out : If the file is symblooc link what file is link to ... (12 Replies)
Discussion started by: madbull41
12 Replies
SNP(4)                                                     BSD Kernel Interfaces Manual                                                     SNP(4)

NAME
snp -- tty snoop interface SYNOPSIS
#include <sys/snoop.h> int ioctl(fd, SNPSTTY, &dev); int ioctl(fd, SNPGTTY, &dev); int ioctl(fd, FIONREAD, &result); DESCRIPTION
/dev/snp is a snoop device which allows users to attach to any tty and watch activities on it. The kernel must be compiled with device snp, or the snp module must be loaded, for these devices to be available. To associate a given snp device with a tty to be observed, open the snp device and a tty device, and then issue the SNPSTTY ioctl on snp device. The argument passed to the ioctl(2) is the address of a variable of type int, holding the file descriptor of a tty device. To detach the snp device from a tty use a pointer to a value of -1. The SNPGTTY ioctl returns information about the current tty attached to the open snp device. The FIONREAD ioctl returns a positive value equal to the number of characters in a read buffer. Special values defined are: SNP_OFLOW device overflow occurred, device detached. SNP_TTYCLOSE tty not attached. SNP_DETACH snp device has been detached by user or tty device has been closed and detached. SEE ALSO
pty(4), sio(4), kldload(8), watch(8) HISTORY
The snp device first appeared in FreeBSD 2.1. In FreeBSD 8.0 the snp driver was rewritten to work with the replaced TTY subsystem. AUTHORS
The author of the current implementation is Ed Schouten <ed@FreeBSD.org>. Previous versions of snp were based on code written by Ugen J.S. Antsilevich <ugen@NetVision.net.il>. BUGS
This version of snp does not return proper error codes when calling FIONREAD. It also does not allow SNPSTTY to detach itself from the TTY. BSD November 5, 2008 BSD
All times are GMT -4. The time now is 12:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy