Commit 99118f0a authored by root's avatar root

Add more samples

parent 6412db16
BLAST/dbs
BLAST/rat-ests
Cufflinks/sample.bam
digits/digits.img
FreeSurfer/buckner_data
FreeSurfer/buckner_data-tutorial_subjs.tar.gz
......@@ -16,4 +17,7 @@ NAMD/stmv
Python/minitwitter.csv
SAMtools/sample.sam.gz
Singularity/vsoch-hello-world-master.simg
Trimmomatic/*.gz
Trimmomatic/*.fa
Trimmomatic/.backup
#!/bin/bash
# Job name and partition
#SBATCH --job-name=ARAGORN-test.slurm
#SBATCH -p cloud
# Run on single CPU
#SBATCH --ntasks=1
# set your minimum acceptable walltime=days-hours:minutes:seconds
#SBATCH -t 0:15:00
# Specify your email address to be notified of progress.
# SBATCH --mail-user=youreamiladdress@unimelb.edu
# SBATCH --mail-type=ALL
# Load the environment variables
module load ARAGORN/1.2.36-GCC-4.9.2
# Run the application
aragorn -o results sample.fa
>derice
ACTGACTAGCTAGCTAACTG
>sanka
GCATCGTAGCTAGCTACGAT
>junior
CATCGATCGTACGTACGTAG
>yul
ATCGATCGATCGTACGATCG
\ No newline at end of file
#!/bin/bash
# Job name and partition
#SBATCH --job-name=BAMM-test.slurm
#SBATCH -p cloud
# Run on single CPU
#SBATCH --ntasks=1
# set your minimum acceptable walltime=days-hours:minutes:seconds
#SBATCH -t 0:15:00
# Specify your email address to be notified of progress.
# SBATCH --mail-user=youreamiladdress@unimelb.edu
# SBATCH --mail-type=ALL
# Speciation-extinction analyses
# You must have an ultrametric phylogenetic tree.
# Load the environment variables
module load BAMM/2.5.0-spartan_intel-2017.u2
# Example from: `http://bamm-project.org/quickstart.html`
# To run bamm you must specify a control file.
# The following is for diversification.
# You may wish to use traits instead
# bamm -c template_trait.txt
bamm -c template_diversification.txt
# BAMM configuration file for speciation/extinction analysis
# ==========================================================
#
# Format
# ------
#
# - Each option is specified as: option_name = option_value
# - Comments start with # and go to the end of the line
# - True is specified with "1" and False with "0"
################################################################################
# GENERAL SETUP AND DATA INPUT
################################################################################
modeltype = speciationextinction
# Specify "speciationextinction" or "trait" analysis
treefile = whaletree.txt
# File name of the phylogenetic tree to be analyzed
runInfoFilename = run_info.txt
# File name to output general information about this run
sampleFromPriorOnly = 0
# Whether to perform analysis sampling from prior only (no likelihoods computed)
runMCMC = 1
# Whether to perform the MCMC simulation. If runMCMC = 0, the program will only
# check whether the data file can be read and the initial likelihood computed
simulatePriorShifts = 1
# Whether to simulate the prior distribution of the number of shift events,
# given the hyperprior on the Poisson rate parameter. This is necessary to
# compute Bayes factors
loadEventData = 0
# Whether to load a previous event data file
eventDataInfile = event_data_in.txt
# File name of the event data file to load, used only if loadEventData = 1
initializeModel = 1
# Whether to initialize (but not run) the MCMC. If initializeModel = 0, the
# program will only ensure that the data files (e.g., treefile) can be read
useGlobalSamplingProbability = 1
# Whether to use a "global" sampling probability. If False (0), expects a file
# name for species-specific sampling probabilities (see sampleProbsFilename)
globalSamplingFraction = 1.0
# The sampling probability. If useGlobalSamplingFraction = 0, this is ignored
# and BAMM looks for a file name with species-specific sampling fractions
sampleProbsFilename = sample_probs.txt
# File name containing species-specific sampling fractions
# seed = 12345
# Seed for the random number generator.
# If not specified (or is -1), a seed is obtained from the system clock
overwrite = 0
# If True (1), the program will overwrite any output files in the current
# directory (if present)
################################################################################
# PRIORS
################################################################################
expectedNumberOfShifts = 1.0
# prior on the number of shifts in diversification
# Suggested values:
# expectedNumberOfShifts = 1.0 for small trees (< 500 tips)
# expectedNumberOfShifts = 10 or even 50 for large trees (> 5000 tips)
lambdaInitPrior = 1.0
# Prior (rate parameter of exponential) on the initial lambda value for rate
# regimes
lambdaShiftPrior = 0.05
# Prior (std dev of normal) on lambda shift parameter for rate regimes
# You cannot adjust the mean of this distribution (fixed at zero, which is
# equal to a constant rate diversification process)
muInitPrior = 1.0
# Prior (rate parameter of exponential) on extinction rates
lambdaIsTimeVariablePrior = 1
# Prior (probability) of the time mode being time-variable (vs. time-constant)
################################################################################
# MCMC SIMULATION SETTINGS & OUTPUT OPTIONS
################################################################################
numberOfGenerations = 5000
# Number of generations to perform MCMC simulation
mcmcOutfile = mcmc_out.txt
# File name for the MCMC output, which only includes summary information about
# MCMC simulation (e.g., log-likelihoods, log-prior, number of processes)
mcmcWriteFreq = 1000
# Frequency in which to write the MCMC output to a file
eventDataOutfile = event_data.txt
# The raw event data (these are the main results). ALL of the results are
# contained in this file, and all branch-specific speciation rates, shift
# positions, marginal distributions etc can be reconstructed from this output.
# See R package BAMMtools for working with this output
eventDataWriteFreq = 1000
# Frequency in which to write the event data to a file
printFreq = 100
# Frequency in which to print MCMC status to the screen
acceptanceResetFreq = 1000
# Frequency in which to reset the acceptance rate calculation
# The acceptance rate is output to both the MCMC data file and the screen
# outName = BAMM
# Optional name that will be prefixed on all output files (separated with "_")
# If commented out, no prefix will be used
################################################################################
# OPERATORS: MCMC SCALING OPERATORS
################################################################################
updateLambdaInitScale = 2.0
# Scale parameter for updating the initial speciation rate for each process
updateLambdaShiftScale = 0.1
# Scale parameter for the exponential change parameter for speciation
updateMuInitScale = 2.0
# Scale parameter for updating initial extinction rate for each process
updateEventLocationScale = 0.05
# Scale parameter for updating LOCAL moves of events on the tree
# This defines the width of the sliding window proposal
updateEventRateScale = 4.0
# Scale parameter (proportional shrinking/expanding) for updating
# the rate parameter of the Poisson process
################################################################################
# OPERATORS: MCMC MOVE FREQUENCIES
################################################################################
updateRateEventNumber = 0.1
# Relative frequency of MCMC moves that change the number of events
updateRateEventPosition = 1
# Relative frequency of MCMC moves that change the location of an event on the
# tree
updateRateEventRate = 1
# Relative frequency of MCMC moves that change the rate at which events occur
updateRateLambda0 = 1
# Relative frequency of MCMC moves that change the initial speciation rate
# associated with an event
updateRateLambdaShift = 1
# Relative frequency of MCMC moves that change the exponential shift parameter
# of the speciation rate associated with an event
updateRateMu0 = 1
# Relative frequency of MCMC moves that change the extinction rate for a given
# event
updateRateLambdaTimeMode = 0
# Relative frequency of MCMC moves that flip the time mode
# (time-constant <=> time-variable)
localGlobalMoveRatio = 10.0
# Ratio of local to global moves of events
################################################################################
# INITIAL PARAMETER VALUES
################################################################################
lambdaInit0 = 0.032
# Initial speciation rate (at the root of the tree)
lambdaShift0 = 0
# Initial shift parameter for the root process
muInit0 = 0.005
# Initial value of extinction (at the root)
initialNumberEvents = 0
# Initial number of non-root processes
################################################################################
# METROPOLIS COUPLED MCMC
################################################################################
numberOfChains = 4
# Number of Markov chains to run
deltaT = 0.01
# Temperature increment parameter. This value should be > 0
# The temperature for the i-th chain is computed as 1 / [1 + deltaT * (i - 1)]
swapPeriod = 1000
# Number of generations in which to propose a chain swap
chainSwapFileName = chain_swap.txt
# File name in which to output data about each chain swap proposal.
# The format of each line is [generation],[rank_1],[rank_2],[swap_accepted]
# where [generation] is the generation in which the swap proposal was made,
# [rank_1] and [rank_2] are the chains that were chosen, and [swap_accepted] is
# whether the swap was made. The cold chain has a rank of 1.
################################################################################
# NUMERICAL AND OTHER PARAMETERS
################################################################################
minCladeSizeForShift = 1
# Allows you to constrain location of possible rate-change events to occur
# only on branches with at least this many descendant tips. A value of 1
# allows shifts to occur on all branches.
segLength = 0.02
# Controls the "grain" of the likelihood calculations. Approximates the
# continuous-time change in diversification rates by breaking each branch into
# a constant-rate diversification segments, with each segment given a length
# determined by segLength. segLength is in units of the root-to-tip distance of
# the tree. So, if the segLength parameter is 0.01, and the crown age of your
# tree is 50, the "step size" of the constant rate approximation will be 0.5.
# If the value is greater than the branch length (e.g., you have a branch of
# length < 0.5 in the preceding example) BAMM will not break the branch into
# segments but use the mean rate across the entire branch.
# BAMM configuration file for phenotypic analysis
# ===============================================
#
# Format
# ------
#
# - Each option is specified as: option_name = option_value
# - Comments start with # and go to the end of the line
# - True is specified with "1" and False with "0"
################################################################################
# GENERAL SETUP AND DATA INPUT
################################################################################
modeltype = trait
# Specify "speciationextinction" or "trait" analysis
treefile = %%%%
# File name of the phylogenetic tree to be analyzed
traitfile = %%%%
# File name of the phenotypic traits file
runInfoFilename = run_info.txt
# File name to output general information about this run
sampleFromPriorOnly = 0
# Whether to perform analysis sampling from prior only (no likelihoods computed)
runMCMC = 1
# Whether to perform the MCMC simulation. If runMCMC = 0, the program will only
# check whether the data file can be read and the initial likelihood computed
simulatePriorShifts = 1
# Whether to simulate the prior distribution of the number of shift events,
# given the hyperprior on the Poisson rate parameter. This is necessary to
# compute Bayes factors
loadEventData = 0
# Whether to load a previous event data file
eventDataInfile = event_data_in.txt
# File name of the event data file to load, used only if loadEventData = 1
initializeModel = 1
# Whether to initialize (but not run) the MCMC. If initializeModel = 0, the
# program will only ensure that the data files (e.g., treefile) can be read
# seed = 12345
# Seed for the random number generator.
# If not specified (or is -1), a seed is obtained from the system clock
overwrite = 0
# If True (1), the program will overwrite any output files in the current
# directory (if present)
################################################################################
# PRIORS
################################################################################
expectedNumberOfShifts = 1.0
# prior on the number of shifts in diversification
# Suggested values:
# expectedNumberOfShifts = 1.0 for small trees (< 500 tips)
# expectedNumberOfShifts = 10 or even 50 for large trees (> 5000 tips)
betaInitPrior = 1.0
# Prior (rate parameter of exponential) on the initial
# phenotypic evolutionary rate associated with regimes
betaShiftPrior = 0.05
# Prior (std dev of normal) on the rate-change parameter
# You cannot adjust the mean of this distribution (fixed at zero, which is
# equal to a constant rate diversification process)
useObservedMinMaxAsTraitPriors = 1
# If True (1), will put a uniform prior density on the distribution
# of ancestral character states, with upper and lower bounds determined
# by the min and max of the observed data
traitPriorMin = 0
# User-defined minimum value for the uniform density on the distribution of
# ancestral character states. Only used if useObservedMinMaxAsTraitPriors = 0.
traitPriorMax = 0
# User-defined maximum value for the uniform density on the distribution of
# ancestral character states. Only used if useObservedMinMaxAsTraitPriors = 0.
betaIsTimeVariablePrior = 1
# Prior (probability) of the time mode being time-variable (vs. time-constant)
################################################################################
# MCMC SIMULATION SETTINGS & OUTPUT OPTIONS
################################################################################
numberOfGenerations = %%%%
# Number of generations to perform MCMC simulation
mcmcOutfile = mcmc_out.txt
# File name for the MCMC output, which only includes summary information about
# MCMC simulation (e.g., log-likelihoods, log-prior, number of processes)
mcmcWriteFreq = %%%%
# Frequency in which to write the MCMC output to a file
eventDataOutfile = event_data.txt
# The raw event data (these are the main results). ALL of the results are
# contained in this file, and all branch-specific speciation rates, shift
# positions, marginal distributions etc can be reconstructed from this output.
# See R package BAMMtools for working with this output
eventDataWriteFreq = %%%%
# Frequency in which to write the event data to a file
printFreq = %%%%
# Frequency in which to print MCMC status to the screen
acceptanceResetFreq = 1000
# Frequency in which to reset the acceptance rate calculation
# The acceptance rate is output to both the MCMC data file and the screen
# outName = BAMM
# Optional name that will be prefixed on all output files (separated with "_")
# If commented out, no prefix will be used
################################################################################
# OPERATORS: MCMC SCALING OPERATORS
################################################################################
updateBetaInitScale = 1
# Scale operator for proportional shrinking-expanding move to update
# initial phenotypic rate for rate regimes
updateBetaShiftScale = 1
# Scale operator for sliding window move to update initial phenotypic rate
updateNodeStateScale = 1
# Scale operator for sliding window move to update ancestral states
# at internal nodes
updateEventLocationScale = 0.05
# Scale parameter for updating LOCAL moves of events on the tree
# This defines the width of the sliding window proposal
updateEventRateScale = 4.0
# Scale parameter (proportional shrinking/expanding) for updating
# the rate parameter of the Poisson process
################################################################################
# OPERATORS: MCMC MOVE FREQUENCIES
################################################################################
updateRateEventNumber = 1
# Relative frequency of MCMC moves that change the number of events
updateRateEventPosition = 1
# Relative frequency of MCMC moves that change the location of an event
# on the tree
updateRateEventRate = 1
# Relative frequency of MCMC moves that change the rate at which events occur
updateRateBeta0 = 1
# Relative frequency of MCMC moves that change the initial phenotypic rate
# associated with an event
updateRateBetaShift = 1
# Relative frequency of MCMC moves that change the exponential shift parameter
# of the phenotypic rate associated with an event
updateRateNodeState = 25
# Relative frequency of MCMC moves that update the value of ancestral
# character states. You have as many ancestral states as you have
# internal nodes in your tree, so there are a lot of parameters:
# you should update this much more often than you update the event-associated
# parameters.
updateRateBetaTimeMode = 0
# Relative frequency of MCMC moves that flip the time mode
# (time-constant <=> time-variable)
localGlobalMoveRatio = 10.0
# Ratio of local to global moves of events
################################################################################
# INITIAL PARAMETER VALUES
################################################################################
betaInit = 0.5
# Initial value of the phenotypic evolutionary process at the root of the tree
betaShiftInit = 0
# Initial value of the exponential change parameter for the phenotypic
# evolutionary process at the root of the tree. A value of zero implies
# time-constant rates
initialNumberEvents = 0
# Initial number of non-root processes
################################################################################
# METROPOLIS COUPLED MCMC
################################################################################
numberOfChains = 4
# Number of Markov chains to run
deltaT = 0.01
# Temperature increment parameter. This value should be > 0
# The temperature for the i-th chain is calculated as 1 / [1 + deltaT * (i - 1)]
swapPeriod = 1000
# Number of generations in which to propose a chain swap
chainSwapFileName = chain_swap.txt
# File name in which to output data about each chain swap proposal.
# The format of each line is [generation],[rank_1],[rank_2],[swap_accepted]
# where [generation] is the generation in which the swap proposal was made,
# [rank_1] and [rank_2] are the chains that were chosen, and [swap_accepted] is
# whether the swap was made. The cold chain has a rank of 1.
(((Balaena_mysticetus:8.81601900,(Eubalaena_australis:1.62202100,(Eubalaena_glacialis:0.34702900,Eubalaena_japonica:0.34702900):1.27499200):7.19399800):19.18398100,(Caperea_marginata:26.06301600,(Eschrichtius_robustus:17.89065500,(((Balaenoptera_acutorostrata:5.27807100,Balaenoptera_bonaerensis:5.27807100):9.82125300,(Balaenoptera_physalus:10.47223400,Megaptera_novaeangliae:10.47223400):4.62709000):0.96736100,(Balaenoptera_musculus:12.84739500,(Balaenoptera_omurai:11.38295800,(Balaenoptera_borealis:5.26532500,(Balaenoptera_brydei:4.32202200,Balaenoptera_edeni:4.32202200):0.94330300):6.11763300):1.46443700):3.21929000):1.82397000):8.17236100):1.93698400):7.85784400,((Physeter_catodon:22.04439100,(Kogia_breviceps:8.80301800,Kogia_simus:8.80301800):13.24137300):11.75461200,((Platanista_gangetica:0.28307000,Platanista_minor:0.28307000):32.10759100,((Tasmacetus_shepherdi:19.19566400,((Berardius_arnuxii:6.28945000,Berardius_bairdii:6.28945000):11.73396200,(Ziphius_cavirostris:15.66970200,((Indopacetus_pacificus:11.02830400,(Hyperoodon_ampullatus:8.10026600,Hyperoodon_planifrons:8.10026600):2.92803800):3.51197900,(Mesoplodon_bidens:13.04286900,(Mesoplodon_traversii:11.07929300,(Mesoplodon_ginkgodens:8.92594300,(Mesoplodon_europaeus:8.25210300,(Mesoplodon_mirus:7.67742400,((Mesoplodon_bowdoini:4.73244800,(Mesoplodon_carlhubbsi:4.17096800,Mesoplodon_layardii:4.17096800):0.56148000):2.44423200,(Mesoplodon_hectori:6.37563100,((Mesoplodon_densirostris:4.92715900,Mesoplodon_stejnegeri:4.92715900):0.86942800,(Mesoplodon_grayi:5.09638400,(Mesoplodon_perrini:4.16622600,Mesoplodon_peruvianus:4.16622600):0.93015800):0.70020200):0.57904500):0.80104900):0.50074400):0.57467900):0.67384000):2.15335000):1.96357700):1.49741400):1.12941900):2.35371000):1.17225200):12.42586500,((Lipotes_vexillifer:24.69821400,(Inia_geoffrensis:18.22641900,Pontoporia_blainvillei:18.22641900):6.47179400):1.30178600,(((Delphinapterus_leucas:5.46643200,Monodon_monoceros:5.46643200):8.59512200,((Neophocaena_phocaenoides:4.98587600,(Phocoena_phocoena:3.70627600,Phocoenoides_dalli:3.70627600):1.27960000):0.63050500,(Phocoena_sinus:4.94717000,(Phocoena_dioptrica:4.04570300,Phocoena_spinipinnis:4.04570300):0.90146700):0.66921000):8.44517400):3.87787200,(Orcinus_orca:10.70277000,((Orcaella_brevirostris:8.20905000,(Grampus_griseus:6.04703000,(Pseudorca_crassidens:5.49324100,(Feresa_attenuata:4.45272000,(Peponocephala_electra:3.04867500,(Globicephala_macrorhynchus:1.47078200,Globicephala_melas:1.47078200):1.57789300):1.40404500):1.04052100):0.55379000):2.16202000):1.22896300,(Lagenorhynchus_albirostris:8.71603900,((Lagenorhynchus_acutus:6.97518500,((Lissodelphis_borealis:1.36135800,Lissodelphis_peronii:1.36135800):3.90213700,((Cephalorhynchus_hectori:3.29116300,(Cephalorhynchus_commersonii:1.82123900,Cephalorhynchus_eutropia:1.82123900):1.46992500):1.27972900,(Lagenorhynchus_obscurus:3.79185300,(Lagenorhynchus_obliquidens:2.91977900,(Cephalorhynchus_heavisidii:2.09621900,(Lagenorhynchus_australis:1.57043300,Lagenorhynchus_cruciger:1.57043300):0.52578600):0.82356000):0.87207400):0.77904000):0.69260200):1.71169000):1.16787300,((Steno_bredanensis:5.89750600,(Sotalia_fluviatilis:3.21256100,Sotalia_guianensis:3.21256100):2.68494500):1.61688800,((Lagenodelphis_hosei:3.44536000,Stenella_longirostris:3.44536000):0.91035700,((Stenella_attenuata:3.07917000,(Tursiops_aduncus:2.19441300,Tursiops_truncatus:2.19441300):0.88475700):0.54694500,(Sousa_chinensis:2.83298000,(Stenella_clymene:1.93481200,((Stenella_coeruleoalba:1.01116300,Stenella_frontalis:1.01116300):0.49557400,(Delphinus_tropicalis:1.26811400,(Delphinus_capensis:0.92486200,Delphinus_delphis:0.92486200):0.34325200):0.23862300):0.42807500):0.89816800):0.79313500):0.72960200):3.15867700):0.62866400):0.57298100):0.72197400):1.26475700):7.23665700):8.06057400):5.62152800):0.76913200):1.40834300):2.05884100);
\ No newline at end of file
#!/bin/bash
# To give your job a name, replace "MyJob" with an appropriate name
#SBATCH --job-name=ABySS-test.slurm
#SBATCH -p cloud
# Run on single CPU
#SBATCH --ntasks=1
# set your minimum acceptable walltime=days-hours:minutes:seconds
#SBATCH -t 0:15:00
# Specify your email address to be notified of progress.
# SBATCH --mail-user=youreamiladdress@unimelb.edu
# SBATCH --mail-type=ALL
# Load the environment variables
module load BBMap/36.62-intel-2016.u3-Java-1.8.0_71
# See examples at:
# http://seqanswers.com/forums/showthread.php?t=58221
reformat.sh in=sample1.fq out=processed.fq
This diff is collapsed.
#!/bin/bash
#SBATCH --partition=cloud
#SBATCH --time=2:00:00
#SBATCH --ntasks=1
mkdir -p data/ref_genome
curl -L -o data/ref_genome/ecoli_rel606.fasta.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/017/985/GCA_000017985.1_ASM1798v1/GCA_000017985.1_ASM1798v1_genomic.fna.gz
sleep 30
gunzip data/ref_genome/ecoli_rel606.fasta.gz
curl -L -o sub.tar.gz https://downloader.figshare.com/files/14418248
sleep 60
tar xvf sub.tar.gz
mv sub/ data/trimmed_fastq_small
mkdir -p results/sam results/bam results/bcf results/vcf
module load BWA/0.7.17-intel-2017.u2
bwa index data/ref_genome/ecoli_rel606.fasta
bwa mem data/ref_genome/ecoli_rel606.fasta data/trimmed_fastq_small/SRR2584866_1.trim.sub.fastq data/trimmed_fastq_small/SRR2584866_2.trim.sub.fastq > results/sam/SRR2584866.aligned.sam
samtools view -S -b results/sam/SRR2584866.aligned.sam > results/bam/SRR2584866.aligned.bam
samtools sort -o results/bam/SRR2584866.aligned.sorted.bam results/bam/SRR2584866.aligned.bam
#!/bin/bash
# To give your job a name, replace "MyJob" with an appropriate name
# Name and Partition
#SBATCH --job-name=CPMD-test.slurm
#SBATCH -p cloud
......
#!/bin/bash
#SBATCH --job-name=Cufflinks-test.slurm
#SBATCH -p cloud
# Multicore
#SBATCH --ntasks=1
#SBATCH --ntasks-per-node=2
# set your minimum acceptable walltime=days-hours:minutes:seconds
#SBATCH -t 1:00:00
# Specify your email address to be notified of progress.
# SBATCH --mail-user=youreamiladdress@unimelb.edu
# SBATCH --mail-type=ALL
# Load the environment variables
module purge
module load Cufflinks/2.2.1-GCC-4.9.2
# Set the Cufflinks environment
CUFFLINKS_OUTPUT="${PWD}"
cufflinks --quiet --num-threads $SLURM_NTASKS --output-dir $CUFFLINKS_OUTPUT sample.bam
"Cufflinks assembles transcripts, estimates their abundances, and tests for differential expression and regulation in RNA-Seq samples. It accepts aligned RNA-Seq reads and assembles the alignments into a parsimonious set of transcripts. Cufflinks then estimates the relative abundances of these transcripts based on how many reads support each one, taking into account biases in library preparation protocols."
Example BAM files from
http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeUwRepliSeq/
#!/bin/bash
# Name and partition
#SBATCH --job-name=FFTW-test.slurm
#SBATCH -p cloud
# Run on single CPU. This can run with MPI if you have a bit problem.
#SBATCH --ntasks=1
# set your minimum acceptable walltime=days-hours:minutes:seconds
#SBATCH -t 0:15:00
# Specify your email address to be notified of progress.
# SBATCH --mail-user=youreamiladdress@unimelb.edu
# SBATCH --mail-type=ALL
# Load the environment variables
module load FFTW/3.3.6-gompi-2017b
# Compile and execute
g++ -lfftw3 fftw_example.c -o fftw_example
./fftw_example > results.txt
# Example from : https://github.com/undees/fftw-example
/* Start reading here */
#include <fftw3.h>
#define NUM_POINTS 64
/* Never mind this bit */
#include <stdio.h>
#include <math.h>
#define REAL 0
#define IMAG 1
void acquire_from_somewhere(fftw_complex* signal) {
/* Generate two sine waves of different frequencies and
* amplitudes.
*/
int i;
for (i = 0; i < NUM_POINTS; ++i) {
double theta = (double)i / (double)NUM_POINTS * M_PI;
signal[i][REAL] = 1.0 * cos(10.0 * theta) +
0.5 * cos(25.0 * theta);
signal[i][IMAG] = 1.0 * sin(10.0 * theta) +
0.5 * sin(25.0 * theta);
}
}
void do_something_with(fftw_complex* result) {
int i;
for (i = 0; i < NUM_POINTS; ++i) {
double mag = sqrt(result[i][REAL] * result[i][REAL] +
result[i][IMAG] * result[i][IMAG]);
printf("%g\n", mag);
}
}
/* Resume reading here */
int main() {