0601214358 IFOM-IEO 9/1/12~10/1/12 0.
3. CHIP on chip pipeline on the Cluster raw cell file bed file( name, score, chromestart, strand rate, TF) cluster peak tracktool basic statistical analysis Makefile # make # make clean # make tar
# # CC = gcc # RM = rm -f # TAR =./$(TARGET).tar.gz # # # DEBUG = -g # CFLAGS = -Wall -O2 $(DEBUG) # LDFLAGS = -lm -mno-cygwin $(WINGUI) $(DEBUG) # Windows GUI #WINGUI = -mwindows # -lxxx # -mwindows # ld # -lkernel32 #advapi32 largeint ole32 scrnsave vfw32 cap lz32 oleaut32 shell32 #win32spl comctl32 mapi32 oledlg snmp winmm comdlg32 mfcuia32 #olepro32 svrapi winserve ctl3d32 mgmtapi opengl32 tapi32 winspool #dlcapi mpr penwin32 th32 winstrm gdi32 msacm32 pkpd32 thunk32 #wow32 glaux nddeapi rasapi32 url wsock32 glu32 netapi32 rpcdce4 #user32 wst icmp odbc32 rpcndr uuid imm32 odbccp32 rpcns4 #vdmdbg kernel32 oldnames rpcrt4 version # TARGET = hello # SRC = hello.c global.c HEADER = global.h OBJ = hello.o global.o.phony: all all: makefile makefile.dep $(TARGET)
$(TARGET): $(OBJ) #.PHONY: makefile.dep makefile.dep: $(SRC) $(HEADER) $(RM) makefile.dep $(CC) -MM $(SRC) >> makefile.dep.phony: clean clean: $(RM) $(TARGET).exe $(OBJ) makefile.dep $(TAR).PHONY: tar tar: tar czvf $(TAR). -include makefile.dep #!/bin/bash. func_shell # func_test 1 #func_shell func_test () if [ $1 -eq 1 ]; then echo "ok!" else echo "no!" fi }
C /*! ****************************************************************************** * brief * ****************************************************************************** */ #include <stdio.h> #include <malloc.h> typedef struct _cell_t struct _cell_t *next; int data; }cell_t; extern int setlist(cell_t *p, int data); extern int deletelist(cell_t* p); extern void alldeletelist(cell_t *p); cell_t g_cell;// int main(int argc, char** argv) g_cell.next = NULL;// setlist(&g_cell, 0); setlist(g_cell.next, 1); deletelist(&g_cell); alldeletelist(&g_cell); } return(0); /*!
****************************************************************************** * fn int setlist(cell_t* p, int data) * param *p * param data * return -1 0 * ****************************************************************************** */ int setlist(cell_t* p, int data) cell_t *tmp; tmp = (cell_t*)malloc(sizeof(cell_t)); if(tmp == NULL) return(-1); } } tmp->next = p->next; tmp->data = data; p->next = tmp; return(0); /*! ****************************************************************************** * fn int deletelist(cell_t* p) * brief * param *p * return -1: 0: * ****************************************************************************** */ int deletelist(cell_t* p) cell_t *tmp; if(p->next == NULL)
} return(-1); } tmp = p->next; p->next = tmp->next; free(tmp); return(0); /*! ****************************************************************************** * fn void alldeletelist(cell_t *p) * brief * param *p * return None * ****************************************************************************** */ void alldeletelist(cell_t *p) cell_t *tmp; while (p->next!= NULL) tmp = p->next; p->next = tmp->next; free(tmp); } } IFOM-IEO Hello guys, Mauro reported to me that you are proceeding very well in getting to know "make", I would like you to try to do this last exercise, then we will start with something serious! This is the problem: - You have to create a directory with a Makefile and, if you think it is needed, some
other file in it. - Put in the directory the text file you obtained at the beginning of the first exercise and name it roba.txt - Someone will then put in the directory a certain number of files, with different names (you do not know in advance the number of files nor the names), all you know is that they will be named ending in ".pat", say that they might be one.pat two.pat three.pat and so on; and then the user will simply type "make". - Each ".pat" file will contain exactly one line with some letters, you have to create the corresponding ".res" files, if something.pat contains "abc" then something.res should contain all the lines of the big file roba.txt which contain the sequence of letters "abc" (NOT case sensitive). - Then you will have to create the ".tot" files, each ".tot" file should contain the sum of the numbers in the lines of roba.txt matched by the ".pat" file. So say that who uses your "tool" has placed a file named pippo.pat containing "ba" then pippo.res will contain 5198 lines and pippo.tot will contain exactly the number 2642832 - Finally you have to create a file results.txt, this single file will contain exactly one line per each ".pat" file you had, these line should contain the name of the ".pat" file without extension and the number in the corresponding.tot file - If the user changes, deletes or adds ".pat" files and types "make" the thing is expected to update what is needed properly As a test case if I put these files acocito@host138:~/thing cat fragola.pat ba acocito@host138:~/thing cat melone.pat ab Then results.txt should contain: fragola 2642832 melone 4530168 Have fun! A. Hi Mauro,
I solved the questoin by the following ways. 1. wget -r cocito.group.ifom.eu/stuff/ 2. cd cocito.group.ifom.eu 3. cd stuff 4. cat roba.txt.gz*>test1.txt.gz 5. gunzip tst1.txt.gz 6. grep -i ^.b[^a].* test1.txt<test2.txt 7. awk 'total=total+$2}endprint total}' test2.txt answer=550194 Hi Mauro, I solved the questoin by the following ways. 1. wget -r cocito.group.ifom.eu/stuff/ 2. cd cocito.group.ifom.eu 3. cd stuff 4. cat roba.txt.gz*>test1.txt.gz 5. gunzip tst1.txt.gz 6. grep -i ^.b[^a].* test1.txt 7. awk 'total=total+$2}endprint total}' test1.txt answer=117627587 4. Cocito google Mauro IFOM-IEO NIH
Italian English Mauro IFOM Cocito Mauro Pino Farewell Party