Demo entry 6717726

construct

   

Submitted by anonymous on Feb 27, 2018 at 21:24
Language: Perl. Code size: 1.0 kB.

#!/usr/bin/perl
use Cwd;
$sbatchdir = "/home/zhuan117/data/ADNI600picked/sbatch602to631/";
$PRODIR = "/scratch/zhuan117/ADNI600picked/pross602to631/";
$FSDIR = "/scratch/zhuan117/ADNI600picked602to631";

open FP1, $ARGV[0];
foreach $line (<FP1>)
{
	#chomp;
	$line =~ s/\x0D?\x0A?$//;
	$rs = $line;						
	$fname = "script-${rs}.sh";
	print $fname, "\n";
	open FP, ">${sbatchdir}/${fname}" || die "open file failed";
	print FP "#!/bin/bash\n";
	#print FP "#SBATCH -p serial\n";
	print FP "#SBATCH -n 2\n";
	#print FP "##SBATCH -A ywang354\n";
	print FP "#SBATCH -o slurm_%j.out\n";
	print FP "#SBATCH -t 3-10:40\n";
	print FP "#!/bin/bash\n";
	print FP "#SBATCH --mail-user=a761005190@gmail.com\n";
  	
	print FP "module load freesurfer/5.3.0\n";
	print FP "module load fsl/5.0.1\n";
	print FP "SUBJECTS_DIR=${FSDIR}\n";
	print FP "cd ${FSDIR}\n";
	#print FP "subfile=\`find $FSDIR/ -name \"${rs}*.nii.gz\" \` \n";	
	$str = "recon-all -i ${rs}.nii -s ${rs} -sd ${PRODIR} -all\n";
	print FP $str;
	close FP;
}
close FP1;						

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).